Hacker News new | ask | show | jobs
by Symbiote 3427 days ago
I laughed when I had to make a minor change to an old web application, and found our tabular, scientific data was being displayed in a series of DIV and SPAN elements, with the CSS table styles applied to them.

I changed it to a real TABLE, since that's far more accessible -- most users can cut and paste into their spreadsheet, and a screen reader might give options to avoid reading out all the data.

Another time, a web developer changed all my <i>Homo sapiens</i> to <em>Homo sapiens</em>.

2 comments

To be perfectly semantically correct (which he was no doubt attempting, as I is a purely visual/appearance tag, and EM connotes some meaning), he should have used

<span lang="la">

<i> is the correct element, so <i lang="la"> if you wish. A taxonomic designation is the first example given in the specification:

"The i element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different quality of text, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, transliteration, a thought, or a ship name in Western texts."

https://www.w3.org/TR/html5/text-level-semantics.html#the-i-...

For the purposes of screen readers, it is suggested to use <em> over <i>. What bugs me is the recent usage of <i> as an icon holder.
See the specification for <i>, a taxonomic designation is the first example of its use.

https://www.w3.org/TR/html5/text-level-semantics.html#the-i-...

Well, I should specify I meant that in most cases using <em> is preferred over <i> in terms of the traditional sense of what <i> was used for in the past. These days both have their specific uses, but in most cases one would more likely to use <em>.

For example, further down the page:

"Authors are encouraged to consider whether other elements might be more applicable than the i element, for instance the em element for marking up stress emphasis, or the dfn element to mark up the defining instance of a term."

As an element it used to be the way to italicize text, to emphasize that text, before CSS. These days it has had a semantic reason for its existence applied which is a slight variation of its original purpose under the HTML4 spec.