html - 如何让文字装饰线线条宽度变短

标签 html twitter-bootstrap css

大家好,我正在想办法让文本装饰线更短,这样它就不会一直延伸下去,我希望它看起来像这样:

enter image description here

#about h1 {
    font-weight: 600;
        font-size: 17px;
        color: #555;
    	text-align: center;
        text-decoration-line: underline;
        text-decoration-style: wavy;
    }
<div id="about">
  <div class="container">
    <h1> GET TO KNOW US </h1>
  </div>
</div>

使用 Bootstrap 3

谢谢

最佳答案

我会使用渐变重新创建它,然后将它放在一个伪元素中,然后您可以轻松调整大小和位置:

h1 {
  font-weight: 600;
  font-size: 17px;
  color: #555;
  text-align: center;
  position: relative;
}

h1:before {
  content: "";
  position: absolute;
  height: 12px;
  top: 100%;
  right:calc(50% - 40px);
  width:80px;
  background: radial-gradient(circle at 50% 100%, transparent 19%, gray 21%, gray 35%, transparent 35%, transparent), radial-gradient(circle at 50% 0%, transparent 19%, gray 21%, gray 34%, transparent 36%, transparent)-116px 0;
  background-size: 16px 16px;
  background-position: -9px 8px, 15px 3px;
}
<h1> GET TO KNOW US </h1>

关于html - 如何让文字装饰线线条宽度变短,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49161473/

相关文章:

javascript - 当输入字段中名称以 "#"符号开头时,如何使我的搜索字段按标签名称过滤图像

css - 使用 Bootstrap 从数据库中检索图像时自动定位图像

css - Bootstrap 3 元素在 google-apps-script html 服务的移动设备上仍然很小

javascript - bootstrap.min.css 和 bootstrap.min.js 有什么区别?

javascript - 使用 cordova 社交共享插件发送带有变量的短信

.net - 如何在我的 .NET 应用程序中托管 HTML5?

javascript - 如何在尚未评估变量的情况下将变量传递给自定义组件?

javascript - 播放来自 tumblr 帖子的音乐

html - 如何将屏幕分成 3 个面板并分别处理每个面板

html - 如何使用:not selector in CSS?