Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is <u> evil while <strong> and <em> is not?

Tags:

Well I know it's not evil just not as pretty in semantics as <strong> and <em> right?

However, with <b> becoming more semantic as <strong> and <i> as <em>, why isn't there a semantic twin for <u>?

In styling:

So there's a CSS style text-decoration:underline for <u>, but isn't there one font-weight:bold for <strong> already? Thus goes <em> too.

In semantics:

<strong> is semantic for what? Strongly emphasized text? <em> is semantic for what? Emphasized text? Anything fundamentally different from each other and mutually exclusive? No. Why can't there be another way to emphasize text? You know, like the way <u> does and makes up a semantic twin for it too - I guess it's just <strong> and <em> are already well implemented in all major browsers before the <b> and <i> become obselete.

I know, now that it's officially become standards, you just have to go with it. Or please have your say: is there a compelling reason to make <u> out of view?

like image 421
datasn.io Avatar asked Feb 08 '09 04:02

datasn.io


People also ask

Should I use strong or B?

The <strong> element is for content that is of greater importance, while the <b> element is used to draw attention to text without indicating that it's more important.

What is the difference between strong B and I em?

b or i means you want the text to be rendered as bold or italics. strong or em means you want the text to be rendered in a way that the user understands as "important". The default is to render strong as bold and em as italics, but some other cultures might use a different mapping.

Should you use the strong tag?

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.

Why do we use B and I tags?

The HTML5 specification redefines b and i elements to have some semantic function, rather than being purely presentational. However, the simple fact that the tag names are 'b' for bold and 'i' for italic means that people are likely to continue using them as a quick presentational fix.


2 Answers

If a semantic twin was created for every previously existing styling tag, all we'd be doing is the same old thing, albeit with new names.

<strong> and <em> are used to give meaning to the marked up text. Their default styling corresponds to <b> and <i> because that's how most people display strength and emphasis in print -- But that can be changed. Whereas using CSS to change a <b> may seem counter intuitive.

So the direct answer to your question is: <strong> and <em> impart meaning to the text, whereas <u> and the others impart styling to the text, which is now done by CSS. The styling applied by the others is incidental.

like image 180
sykora Avatar answered Sep 30 '22 04:09

sykora


It gets mistaken for a hyperlink.

like image 44
oglester Avatar answered Sep 30 '22 03:09

oglester