Anne van Kesteren

Markup is all about personal opinions

Markup seems easy, everyone can learn XML. Once you learn more about markup you know less I think. Yesterday I made a post where a said that the i and b elements should be removed. I still think that, I'm not convinced by someone, but the arguments of the 'commenters' sounded correct. The arguments on the mailing list however also sound correct. So what should we use?

i and b can have ‘semantic meaning’ in certain circumstances:

Looking over the index entry for 'Italics' in my Chicago Manual of Style, I see that italics can be used for emphasis, foreign words, genus and species, key terms, legal cases, letters as letters and words as words, letters in enumeration, math, questions (as quotatives), rhyme schemes, ship names, stage directions, subheads, technical terms, theorems, and titles (of books, journals, movies, musical works, paintings, plays, and poems).

There are also examples for where you will need the b element to 'style' something boldfaced. These are probably the reasons they still exist within XHTML1.1 although there are of course also (good) reasons against these elements. Some people think span is useless with a class assigned to replace i & b, others thing that you could make a markup language just with span and classes. Maybe markup is all about personal opinions. On some points people agree. On the small things however, we all think different. And that's of course, 'cause we are human and we can think for ourselves (and some people just know more).

Comments

  1. Logically all body markup could be done utilising only div and span.

    But non div/span tags are available for 2 reasons.

    1. For non-css aware user-agents.
    2. To easily imply meaning for often used structual elements.

    Whether you use span,em,strong,i or b in your markup is as you say currently down to personal preference. This, one could suggest is a failure in the 'standard'. For more widespread adoption of 'standards' the W3C should only allow a single solution for a regular markup problem.

    Posted by cedartree at

  2. I don't see what's so compelling about the blockquoted argument. HTML has some specific tags for commonly italicized elements such as emphasis and citations, but there are obviously specialized uses missing from it. So just add a span with a class. EG: <span class="genus">Homo sapien</span> or <span class="title">The Origin of Species</span>. That way, if you decide that maybe you want your book titles in roman small-caps instead of italics or that you want your genera in green as well, you can change them individually.

    For b and i to be anything but purely presentational, their affected text would have to have no structural role at all. And there should always be a consistent rule for one's styling, which is why CSS works so well.

    Posted by J.C. Fields at

  3. In my comment [1] on the previous article I hinted that semantics and markup are different and are ambiguous. The use of span and class removes part of this ambiguity and leaves room for semiotics. Now things are getting really complicated and unnecessary, my head is starting to hurt.

    Anyway... Don't forget many editors must use a CMS to submit content. Semantics and Semiotics are then more of an abstraction and need not burden the editor. Typographical markup such as b and i allow the editor to assert some control in how a text is read or scanned. Even if the CMS has a WYSIWYG capability the application of b and i is still valid in my view. Using span just seems like overkill especially if you're sending your page to a mobile device. Minimal markup has it's place so let's not get carried away with CSS and apply it to everything.
    Having said that I may need to take another look at my own webpages ;)

    [1] comment 227

    Posted by Egor Kloos at

  4. W3C has changed its mind with regard to <cite>. Originally, it was:

    The CITE element is used to indicate the title of a book or other citation. It is usually presented in italics.

    The example given here: http://www.w3.org/MarkUp/ht....is:

    <cite>Moby Dick</cite> is a book title.

    No indication there that anything is literally being cited. However, more recently: http://www.w3.org/TR/html40... we have:

    As <CITE>Harry S. Truman</CITE> said,
    <Q lang="en-us">The buck stops here.</Q>

    which seems to be restricting it to the use Jacques described.

    Best if people do what they're comfortable with. Many issues of this sort are fairly small matters to strike positions on and perhaps Mark Pilgrim's is sensible to say, as he does in his excellent recent piece, if such things don't affect accessibility, he "doesn't care":
    http://diveintomark.org/arc....

    Posted by Michael at

  5. In response to the question on semantics you posted on my site, see my reply here: http://patrick.lioi.net/arc...

    If my understanding is faulty, please feel free to correct me!

    Posted by Patrick Lioi at