在div中的样式h1

use*_*265 12 html css

我想在div中设置h1标题,但无论我尝试什么,它总是保持粗体.

小提琴

HTML

<div class="header">
<h1> Hello World </h1>
Run Code Online (Sandbox Code Playgroud)

CSS

.header h1{
font-style: normal;
color: grey;
}
Run Code Online (Sandbox Code Playgroud)

mel*_*cia 12

你需要font-weight:

.header h1{
    color: grey;
    font-weight: normal;
}
Run Code Online (Sandbox Code Playgroud)

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


Álv*_*lez 7

font-style无关大胆:

字体样式CSS属性允许在字体系列中选择斜体或倾斜面.

你想font-weight,而不是:

font-weight CSS属性指定字体的粗细或粗体.但是,某些字体并非所有权重都可用; 有些仅适用于普通和粗体.