如何删除标题中的粗体?

我有个标题:

<h1>THIS IS A HEADLINE</h1>

我怎样才能使“这是... ...”这个短语不显得大胆,而其余的都没有改变呢?

我在文字装饰中找不到任何相关的标签。

203858 次浏览

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)

Try font-weight:normal;

h1 {
font-weight: normal;
}

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: 3.2. Font weight: the font-weight property

<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.

style is accordingly vis CSS. An example:

<h1 class="mynotsoboldtitle">I'm not bold</h1>
<style>
.mynotsoboldtitle { font-weight: normal; }
</style>
<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 :)

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}

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;

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.

If you want to remove the bold, you can use the code below,

h1 {
font-weight: normal;
}

But 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;
}

Code example result,

h1 span {
font-weight: normal;
}
<h1><span>THIS IS</span> A HEADLINE</h1>