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.
No. There isn't a CSS style for <strong>
or <em>
. There are CSS tags for bold, but that is not the same thing. strong and em do not mean bold. They mean emphasize. Emphasize can be done with underlining, with italic or with bold in a textual media, and it's up to the stylesheet to decide which. But the semantic meaning is simply "this text is emphasized". And how would you implement "underline" in a screen reader? It doesn't make sense. underline is specific to textual media, and thus belongs in the specific stylesheet for textual presentation, and not in the semantic HTML which could be used to present data through speech or any other media.
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
Because strong and em do not specify how the text should be emphasized, just that it should be emphasized. underline specifies how it should be emphasized, thus it has to do with presentation, rather than semantics, and belongs in a CSS file.
I agree that the difference between strong and em is vague, but then again, we also have h1-h7. The point is that even without a stylesheet, a reader should be able to infer that "this is bigger headline than that", and so also "this text is more emphasized than that".
The semantic meaning of tags do not have to be fundamentally different from each others. It's perfectly meaningful to have semantic tags that simply mean "more so than this other semantic tag". Because sometimes we have a need for several layers of headlines in our text, so we have h1-h7. And sometimes we have a need for text that is emphasized, and text that is very emphasized. But even if we didn't, it still wouldn't be an excuse for adding <u>
as "another semantic twin", because it isn't. It's not a semantic twin, it is nothing in semantics. underline does not necessarily mean emphasis. It could mean headline as well, or it could mean "this is a link", or it could mean anything else you want it to mean. It is a presentation detail. And it is meaningless in a non-text media. "emphasis" is not a presentation detail. It carries a semantic meaning which makes sense no matter the media. You can emphasize information in movies too, or in video games, or in text read aloud.
You seem to be under the impression that strong and em are just shorthand (or longhand) for bold or italic. That's not true. They may be used to present bold text, underlined text, or italic text, or larger text. Or they can be ignored completely. Or they may simply alter the pronunciation in a screen reader. If you've ever written documents in LaTeX
, you'll note that the \emph
command there is typically rendered as italic, not bold. Of course it's not required to, but that's a perfectly legal interpretation of the semantic "emphasis" command. Similarly, there are many other tags which may just end up rendered as italic (quotes, or span tags with certain CSS classes or even headlines.
<u>
, on the other hand, has a very specific meaning in presentation, but carries no semantic value. What information does it convey to the reader? <strong>
carries the meaning "this text is highlighed and should be paid attention to", because it is strongly emphasized. What does it mean for text to be underlined? It could mean nothing, or it could mean a dozen different things.
"italic", "bold" or "underline" are presentational attributes with no semantic meaning. They can be applied to any semantic HTML tag you like. And semantic tags like strong or em can use any presentational CSS rules you like. There is no 1:1 mapping as you seem to believe. They are different concepts. The fact that the browser by default chooses to render strong text as bold is completely irrelevant. That's just a default behavior, because they had to choose something, and it can be overridden in CSS.
It's not a question of "can this be done in CSS", or "Is this a semantic twin of that", but simply "does it have a semantic meaning? Does it have a presentational meaning"? If yes to both, it should be changed and/or removed entirely. If yes to the former, it belongs in HTML, and if yes to the latter it belongs in CSS.