Anne van Kesteren

Semantic markup

Let’s all make some semantic improvements today. Substitute the B element with STRONG and do likewise for I and EM. Replace your tables with semantic markup instead of the other way around.

In related news, I was invited by Microsoft to join the Internet Explorer Quality Assurance team. I can start right after my exams.

The above was a joke, for all the people that didn’t catch the date. If I ever make another joke it will be one that fewer people take for granted :-)

Comments

  1. Simply replacing <b> by <strong> is not the right thing to do! In the most used browsers they look the same, but many times people use <b> to put emphasis on a word, so <em> might be better suited. The right advise would be to review the semantic meaning of your code.

    Posted by Jeroen at

  2. <naive>Congratulations! ;-)</naive>

    Posted by Krijn Hoetmer at

  3. Microsoft has an Internet Explorer Quality Assurance team? ;-)

    Posted by Doug Wright at

  4. April Fools!

    Posted by Switch at

  5. Doug, that actually was the first thing that surprised me :P

    Posted by Rob Mientjes at

  6. Well done, and say; "Hello" to Bill from me. ;-)

    Posted by Robert Wellock at

  7. Congrats on being signed up for the IE QA team. I can't think of anyone better suited to this role. I hope you're being paid!

    Posted by Dean Edwards at

  8. Also, i doesn't automatically translate to em. It might require a cite... The general ideas behind the post are good -- semantic markup

    Posted by Juan Carlos at

  9. Congratulations, good start in this new month :*)

    Posted by drwitt at

  10. Not all <i> and <b> are bad. My company sells a product called MemberDirect. It turns out that the italicized "Direct" is a requirement. In this case its only correct to use a <i>; its italicized, not emphasized. <em> would be semanitcally incorrect; it would imply that the Direct is emphasized, but that's not true.

    Huh. I just tried to preview this and your comment code forbids the use of <i> which means that I have to use what is, in this case, semantically incorrect markup.

    How's that for irony?

    Posted by Adam at

  11. Also the W3C has announced it will deprecate punctuation with effect from xhtml2 as it is too presentational and doesn't really mean anything so it may be worthwhile removing any full stops commas apostrophes colons and semi colons at the same time to make your pages even more semantic

    Posted by mattur at

  12. If you want to italicise your text, but aren't emphasising anything in particular, then just use a styled span or cite. Emphasis tags require UAs to emphasise the content, something which Italic tags don't do. Moreoever, em tags are not necessitated to italicise, it's just that some UAs happen to interpret them that way.

    Posted by jbot at

  13. I was invited by Microsoft to join the Internet Explorer Quality Assurance team.

    Can you tell us more about what that means?

    Posted by Kees at

  14. I truly hope the QA thing isn't a joke!

    However, you probably would give it more attention if you didn't joke...

    Posted by Bart Verkoeijen at

  15. Okay, you had me with the semantics thing ("Surely he isn't condoning mindless semantics?!"), then the second paragraph was the tip-off. ;-)

    I see a few other people have forgotten the date though. :-p

    Posted by Sage at

  16. I didn't suspect jokes on this blog

    Posted by Kees at

  17. Maybe we should all mail Microsoft about this joke actually being a rather good idea!

    Posted by Marco at

  18. Anne, it's too late now! We're getting you on that team. If there's no team we'll have to create that too...

    Is this why there are no famous dutch comedians? April Fools jokes are supposed to be silly not sensible!

    Posted by Dean Edwards at

  19. If you want to italicise your text, but aren't emphasising anything in particular, then just use a styled span or cite.

    Uh, what? How is a styled span any better than an i, or the latter any worse than the former? Answer: it’s not, both are precisely the same thing, they have exactly zero semantics.

    But cite does have semantics, so employing it for presentation clearly is abuse.

    Posted by Aristotle at

  20. This is surely an april's fool, isn't it? :D

    For those who did not get it: B != STRONG and I != EM.

    Semantics? What do standards have to say on that?

    EM:
    Indicates emphasis.
    STRONG:
    Indicates stronger emphasis.
    I:
    Renders as italic text style.
    B:
    Renders as bold text style.

    If (small) “emphasis” means “italicising”, hm, I'm lost. :(

    Posted by altblue at

  21. The premise of just plainly replacing <b> with <strong> never seemed right to me. As pointed out by others above they mean different things.

    Content is always scanned first and never read first. Print based design always needed to set a bold or alternate typeface to make a word scannable for the reader. The word is selected based on an appeal and not it's contextual meaning. Designers always struggle with this when typesetting.

    Web based work doesn't suffer from this. Because it can do both with either <b> or <strong>.

    Posted by Egor Kloos at

  22. I never use bold because i allways make that the important words are links

    Posted by Mario De Zutter at

  23. How is a styled span any better than an i.

    Aristotle, you're implying that I said span tags are more semantic than italic ones but if you re-read my post I said nothing of the kind.

    All I was stating was that there was no difference between the two methods, save that the proper approach to italicise text is stylising it using CSS, thereby avoiding deprecated tags such as bold and italics. These are not semantic because they confer no meaning on the document, only being used to format their containing elements. The same is true of spans, though not cites which denote more than just look-and-feel.

    Posted by jbot at

  24. Elements B and I are not deprecated... I do not like them either, however ;)

    Posted by Rimantas at

  25. Nor should they be deprecated. Many users may find no application for them, but many others would. For example, in a citation of a book, the book name should be in italics, and an em tag would be completely inappropriate.

    Posted by Tim G at

  26. Tim: although it could be argued that you mark up the book name semantically, use some meanginful element inside a cite element with class="book". Then you italicize the name in the stylesheet.

    jbot: you can certainly style your i elements in your stylesheet. Any unsemantic tag is as good as any other, so when you have a lot of repetition, b or i may even be preferrable over span because the markup is shorter overall.

    Posted by Aristotle at

  27. In other words, replace a simple italics tag with a bunch of markup? I don't think so.

    Posted by Tim G at