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 18:53

You want font-weight, not text-decoration (along with suitable additional markup, such as <em> or <span>, so you can apply different styling to different parts of the heading)

查看更多
一夜七次
3楼-- · 2019-03-22 18:54
<h1><span style="font-weight:bold;">THIS IS</span> A HEADLINE</h1>

But be sure that h1 is marked with

font-weight:normal;

You can also set the style with a id or class attribute.

查看更多
太酷不给撩
4楼-- · 2019-03-22 19:00

style is accordingly vis css. An example

<h1 class="mynotsoboldtitle">Im not bold</h1>
<style>
.mynotsoboldtitle { font-weight:normal; }
</style>
查看更多
forever°为你锁心
5楼-- · 2019-03-22 19:01

Try font-weight:normal;

h1 {
    font-weight: normal;
}
查看更多
干净又极端
6楼-- · 2019-03-22 19:04

you can simply do like that in the html part:

<span>Heading Text</span>

and in the css you can make it as an h1 block using display:

span{
display:block;
font-size:20px;
}

you will get it as a h1 without bold ,
if you want it bold just add this to the css:

font-weight:bold;
查看更多
Viruses.
7楼-- · 2019-03-22 19:04

You can use font-weight:100 or lighter: this is working with i.e. Opera 16 and older, but I do not know why the h1 tags in Firefox are bolder, sorry.

查看更多
登录 后发表回答