Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does it matter <strong> in <em> or <em> in <strong>?

Does it matter <strong> in <em>

<p><strong><em>Some text</em></strong></p>

or <em> in <strong>?

<p><em><strong>Some text</strong></em></p>

Which is semantically correct and more accessible?

Update:

How screen reader would behave in both situation?

like image 339
Jitendra Vyas Avatar asked Feb 04 '10 14:02

Jitendra Vyas


People also ask

What is strong em?

The <strong> tag should be used to indicate strong importance, seriousness, or urgency, like to indicate key phrases in a text for someone skimming it. The <em> tag should be used to represent stress emphasis, like when you'd read the emphasized text in a different tone of voice.

How do you use Strong and em element?

While <em> is used to change the meaning of a sentence as spoken emphasis does ("I love carrots" vs. "I love carrots"), <strong> is used to give portions of a sentence added importance (e.g., "Warning!

What is the difference between strong B em I?

General consensus is that 'em' and 'strong' should be used as they indicate semantic meaning (i.e. 'This text or word is more important than the others') as well as how the text should look (i.e. 'This word should be bold or italic'), whereas 'b'and 'i' only do the latter.

What is strong and em tag?

<strong> is a tag you'd put around a sentence or phrase to indicate that "this is more important than the surrounding text". <em> is generally used to indicate the stress of a word within a sentence. For example: In spite of what some might say, there is a semantic difference between the elements.


2 Answers

Syntactically correct but not semantically correct. <strong> is an "higher order" form, so to speak, of <em>. If you're looking for the effect of <b> and <i>, use CSS. Remember to not choose elements because of how they look but what they mean.

like image 191
Andrew Noyes Avatar answered Oct 24 '22 17:10

Andrew Noyes


Both ways you have listed are perfectly correct markup-wise, as long as you're not mixing up the order of the closing tags. This would be incorrect:

<p><em><strong>Some text</em></strong></p>
like image 37
Ben Avatar answered Oct 24 '22 19:10

Ben