html - 将 font-weight 设置为 100 后,文本字体仍然是粗体

标签 html css fonts

我想要我的字体粗细像这个标题 website h2元素
我正在使用下面的 css,我尝试了所有方法,但我网站上 h2 元素的字体粗细仍然是粗体,那么这个

CSS:

h2 {
 color: #2598ea;
 font: normal normal 300 38px / 51px "Open Sans", Calibri, Helvetica, Arial, Verdana, sans- serif;
 text-transform: none;
}

我真的不知道这段代码有什么问题

最佳答案

回到基本问题,我认为这才是问题的关键。您是否从谷歌字体加载了正确的字体粗细?当您从其中选择您喜欢的字体时,请确保选择适当的字体粗细。

如果不是,请确保使用以下代码将其放入 html head 中。

检查我的代码笔以了解如何执行此操作。

代码笔:http://codepen.io/Travo100/pen/rdLmG

<!-- font-weight of 300 included here -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
<h2> Welcome to Ardent Engineers </h2>

h2{
  color: #2598ea;
  /*font weight of 300 here*/
  font: normal normal 300 38px / 44px "Open Sans", Helvetica, Arial, Verdana, sans-serif;
  text-transform: none;
 }

关于html - 将 font-weight 设置为 100 后,文本字体仍然是粗体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23821318/

相关文章:

php - 选项卡式 jQuery 搜索结果

javascript - 如果我在 AJAX 中使用 .append,如何将 .each 用于 div?

fonts - 导出 react-bootstrap 时如何使用 Glyphicons

html - iframe 播放器和上面的横幅

javascript - Html:工具提示隐藏在带滚动的分屏上的 div 后面(需要在父容器上保留 "overflow-y:auto")

html - 使用 CSS 对齐文本框会推出标签

html - 带有描述的 CSS Card ionic left div

html - 如何使用 CSS 规范化按钮和 anchor ?

java - 如何为 PdfContentByte 设置下划线——iText

css - 如何在不将其上传到元素的情况下使用 FontAwesome 字体图标?