html - 在 div 中设置 h1 样式

标签 html css

我想在 div 中设置 h1 标题的样式,但无论我尝试什么,它始终保持粗体。

js fiddle

.header h1 {
  font-style: normal;
  color: grey;
}
<div class="header">
  <h1> Hello World </h1>
</div>

最佳答案

你需要font-weight:

.header h1{
    color: grey;
    font-weight: normal;
}

演示:http://jsfiddle.net/h6EtB/2/

关于html - 在 div 中设置 h1 样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19766401/

相关文章:

javascript - 如何在页面滚动上为图像设置动画?

css 下拉菜单出现在第一个选项卡

javascript - JQuery CSS : I need to add a css style class to my button in the table.

javascript - 将数组元素插入表 JavaScript/并防止随机数重复

html - 文本在 HTML 输入中未正确对齐。我的代码要更改什么?

javascript - 为什么网站管理员使用 `ul/li` 而不是 `div` 进行布局?

javascript - 悬停其他内容时下拉/显示一个区域的特定内容

javascript - 将对象保持在边界内

javascript - Flickr API 和 JavaScript 函数?

JavaFX 硬焦点丢失在其他窗口区域单击