开发者

HTML <strong> tag

Is using more than one

<strong> 

tag actually make the word stronger?

i.e. is

<strong><strong>abc</strong></strong>

stronger than

<strong>abc</strong&开发者_如何学JAVAgt;

?

I'm asking this because if you view the HTML source of the official website of North Korea, http://www.korea-dpr.com/ you will see it has many strong tags. Is this supposed to be something like an IE hack?

Thanks in advance.


HTML <strong> tag

Yes, you can nest strong tags and the more you nest, the stronger it becomes. Although I'd say beyond 2-3 nested is extraneous.

The relative level of importance of a piece of content is given by its number of ancestor strong elements; each strong element increases the importance of its contents.

Source: HTML 5 spec

Some modern user agents will apply font-weight:bolder; to strong, though since it's already bold you won't really notice a visual difference. If you want, you can apply a rule such as the % so nested strong elements become larger, as indicated in the other answer.

Some screen readers might dictate the word out more loudly.

Seems like JAWS/Window Eyes screen readers don't indicate importance, according to this.


Theoretically, I think it could be made to do this with a relative CSS declaration like such:

strong { font-size: 120%; }


<strong> is a semantic tag, as all HTML tags. It don't say that that word is bold, but that have a strong emphasis. You have to use CSS to style the element.I suggest you to read this CSS Property: font-weight and the whole website. Anyway usually web fonts don't have more than one level of "boldness" so you have to denote emphasis in another way (font size, color, etc...)


Like other have said, use a percentage if you want each nested one to make it even larger. If you want (I don't know why you would) to control explicitly how many deep you can go and what other attributes that entails, then you could also say

strong { font-weight: 100; }
strong strong { font-weight: 300; font-size: 1.1em }
strong strong strong { font-weight: 500; font-size: 1.1em; color: red; }

edit: by percentage, i meant to use font-weight: bolder... not percentage font-weights (which I'm not sure are supported)


I don't think nesting <strong> tags will make it stronger.

Edit Guess I was wrong about nesting bold tags make the font stronger based on other answers.

I would recommend using CSS with class names instead of <strong>. The CSS font-weight property offers a variety of options that you can use to incrementally bold a word

.strong
{
    font-weight: bold; 
    /* Other options bold, bolder, lighter, normal, 100...900 */
}

.stronger
{
    font-weight: bolder;
}

.strongest
{
    font-weight: 900;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜