4 ms·
Amusingly, the MDN guidance [0] on <em> vs <i> is exactly backwards from the example they give a paragraph below: > The <em> element represents stress emphasis
by vermilingua 3y ago
Amusingly, the MDN guidance [0] on <em> vs <i> is exactly backwards from the example they give a paragraph below:
> The <em> element represents stress emphasis of its contents, while the <i> element represents text that is set off from the normal prose, such as... when the text refers to the definition of a word instead of representing its semantic meaning.
And then [1]:
<p>
In HTML 5, what was previously called
<em>block-level</em> content is now called <em>flow</em> content.
</p>
...which would be an exemplar case of when to use <i>.
[0] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em#i_vs._em https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em...
[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em#examples https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em...
- andai 3y agoI thought <em> was semantic ("emphasis") and <i> is stylistic ("italics")? And last I heard (when <em> came out) you weren't supposed to use <i> anymore because it's bad form to use HTML for styling! Much like <center>.
- Timwi 3y agoYes, that was the mantra some 15–20 years ago. Then HTML 5 came out, in which <center> was indeed obsoleted, but <i>/<b>/<u> weren't and instead got a semantic meaning. (A semantic meaning which, admittedly, is subtle, borderline esoteric, so it's very rarely used as intended.)
- psychoslave 3y agoMade me read https://www.w3.org/International/questions/qa-b-and-i-tags https://www.w3.org/International/questions/qa-b-and-i-tags I think that at this point I can keep my usual habit of avoiding them completely.