【问题标题】:font in bootstrap select box引导选择框中的字体
【发布时间】:2020-04-16 19:16:56
【问题描述】:

我尝试使用 Poppins 字体显示选择选项文本。类是

.poppinsregular14diese00000061 {
    font-family: Poppins;
    font-weight: 400;
    font-size: 14px;
    color: #00000061;
}

小提琴如下:https://jsfiddle.net/flamant/dvzh57wu/14/

但显示的文本与 div 或文本输入中相同类型的类文本显示的不同

【问题讨论】:

  • 寻求代码帮助的问题必须包括在问题本身最好是在堆栈片段中重现它所需的最短代码。尽管您已经提供了一个链接,但如果它变得无效,那么您的问题对于未来遇到同样问题的其他 SO 用户将毫无价值。见Something in my website/example doesn't work can I just paste a link

标签: css bootstrap-4


【解决方案1】:

看起来 .custom-select-lg 类覆盖了您的字体大小(1,25rem),而不是在层次结构中,.custom-select 将覆盖您的字体大小为 1rem。如果您真的希望将 14px 应用于选项,请使用内联样式

<select  class="browser-default custom-select custom-select-lg mb-3" style="float:left;width: 255px;height: 40px; font-size:14px"  placeholder="By myself" formControlName="byWho">

另一方面,我并不真正建议像你那样使用内联样式,代码会在一段时间后变得混乱

【讨论】:

    猜你喜欢
    • 2012-11-18
    • 2021-09-25
    • 2012-05-20
    • 2014-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多