how to remove the bold from a headline?

2019-03-22 18:18发布

I have a headline:

<h1>THIS IS A HEADLINE</h1>

How do i make the phrase "THIS IS..." not to be bold and the rest without a change? couldn't find any relevent tag in text-decoration.

标签: css xhtml
9条回答
太酷不给撩
2楼-- · 2019-03-22 19:08

The heading looks bold because of its large size, if you have applied bold or want to change behaviour, you can do:

h1 { font-weight:normal; }

More: http://www.w3.org/TR/css3-fonts/#font-weight-prop

查看更多
淡お忘
3楼-- · 2019-03-22 19:09

for "THIS IS" not to be bold - add <span></span> around the text

<h1>><span>THIS IS</span> A HEADLINE</h1>

and in style

h1 span{font-weight:normal}
查看更多
Explosion°爆炸
4楼-- · 2019-03-22 19:14
<h1><span>This is</span> a Headline</h1>

h1 { font-weight: normal; text-transform: uppercase; }
h1 span { font-weight: bold; }

I'm not sure if it was just for the sake of showing us, but as a side note, you should always set uppercase text with CSS :)

查看更多
登录 后发表回答