gpt4 book ai didi

css - 更改字体粗细时的奇怪行为 : to bold

转载 作者:行者123 更新时间:2023-11-28 00:52:18 32 4
gpt4 key购买 nike

我正在尝试将按钮文本的粗细更改为粗体(在某些情况下)。为此,我在 bootstrap.css 中创建了一个新类,基本上是带有 font-weight: bold 的 btn 类的副本——我将该类命名为 btnbold:

.btnbold {
display: inline-block;
padding: 6px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: bold;
line-height: 1.428571429;
text-align: center;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
border: 1px solid transparent;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}

然后我编写了以下代码来观察按钮的各种变化,包括将文本加粗:

<button type="button" class="btn">Basic</button>

<button type="button" class="btnbold btn-default">Bold Default</button>

我在我的开发区测试了这段代码,“Bold Default”按钮看起来和我预期的一样——文本是粗体。当我通过更改我们的网站导出时,“Bold Default”按钮文本不是粗体,但按钮边框有凸起的外观。我在这两种情况下都使用 IE。

帮助 ????

谢谢丰富

最佳答案

永远不要依赖font-weight .有些字体没有粗体(实际上大多数谷歌字体不支持 font-weight )。最好@import<link>该字体的粗体版本。

如果字体是您的更改之一,请确保新字体支持粗体。

如果你没有改变字体,我会推荐你​​阅读this solution .

关于css - 更改字体粗细时的奇怪行为 : to bold,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53146349/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com