是否有任何 Bootstrap 类别的 font-weight: bold和其他值的 font-weight?
font-weight: bold
font-weight
我不会创建一个新的,如果这已经存在于 Bootstrap。
我在 引导网站中发现了这个,但它实际上不是 Bootstrap 类,它只是 HTML。
<strong>rendered as bold text</strong>
在您的 Site.css (或其他位置)中创建一个名为示例的新类。Font-bold 并将其设置为您的元素
.font-bold { font-weight: bold; }
你应该使用 bootstarp 的变量来控制你的字体重量,如果你想要一个更自定义的值和/或你正在遵循一个方案,需要重复; 在整个项目中,变量被用作一种集中和共享常用值(如颜色、间距或字体堆栈)的方式;
你可以在 http://getbootstrap.com/css找到所有的文档。
在 鞋带4中,class="font-weight-bold"就是您要寻找的。
class="font-weight-bold"
对于其他样式,有 font-weight-normal和 font-italic类。
font-weight-normal
font-italic
在 鞋带4:
或者:
<strong>text</strong>
在 Bootstrap 4上你可以使用:
<p class="font-weight-bold">Bold text.</p> <p class="font-weight-normal">Normal weight text.</p> <p class="font-weight-light">Light weight text.</p>
如果你在 Mac 版 Chrome中检查这个,我认为有一些浏览器不兼容。
试试这个
* {-webkit-font-smoothing: antialiased;}
如果使用 五号胸带,最准确的方法是下面的例子:
<p class="fw-bold">Bold text.</p>
对于 Bootstrap 5:
class="fw-bold"
为了4号鞋带
在 Bootstrap 4和5上你可以使用:
<p class="fw-bold">Bold text.</p> <p class="fw-bolder">Bolder weight text (relative to the parent element).</p>
Https://getbootstrap.com/docs/5.0/utilities/text/