html - 基本的 css 字体粗细属性不起作用

标签 html css fonts

我的 html:

<div id="unsurpassed">
  <p>
    <span>FIRE </span>| Unsurpassed Efficacy
  </p>
</div>

我的 CSS:

#unsurpassed {
margin-top: 20px;
font-size: 32px;
font-family: "Myriad Pro";
}

#unsurpassed p {
color: #77787B; 
font-weight: 300;
}

#unsurpassed span {
color: #1D74B6; 
font-weight: 400; 
}

我希望“| Unsurpassed Efficacy”这个短语比目前没有发生的“FIRE”轻得多,我不确定为什么。

最佳答案

尝试使用 normalbold 作为 font-weight 而不是数字。

演示:http://jsfiddle.net/8rHbv/2/

CSS:

#unsurpassed {
    margin-top: 20px;
    font-size: 32px;
    font-family:"Myriad Pro";
}
#unsurpassed p {
    color: #77787B;
    font-weight: normal;
}
#unsurpassed span {
    color: #1D74B6;
    font-weight: bold;
}

关于html - 基本的 css 字体粗细属性不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24338273/

相关文章:

jquery - 如何添加缩放效果以查看我的表格文本详细信息

html - 为什么文字装饰: underline not work?

html - 网格中的文本重叠

svg - SVG 字体的新语法是什么?

html - 在swift 4.2中加载动态html页面时,如何在iOS上实现wkWebview的本地自定义字体?

html - 在选择框中删除 "default"<option>

html - 在移动设备上查看时更改背景

html - @font-face AwesomeFont 不起作用

javascript - 访问从另一个文件加载的 id

html - 当我调整网络浏览器大小时,我的文字从我的图像上移开?