Why you should be using XHTML Strict

Written June 5, 2009. 11 comments.

The truth be told, there’s no good reason to be using the Transitional doc type in modern web design. At least IMHO. XHTML Strict as the name suggests is a more disciplined flavour of HTML, but it has the added advantage of forcing you to separate the presentation from the structure.

This is partly because a lot of the valid attributes in Transitional that some designers use for presentation are actually invalid in Strict, such as align, background, border, height and width (except on images) and many more. With these attributes being illegal you are only left with one option for presentation: CSS. That’s a good thing.

Web browsers are rather forgiving with Transitional (or HTML Lazy as I sometimes call it), but it’s only intended to be used for when you have older legacy code that can’t make the jump to Strict, and I think this is the reason why a lot of designers still prefer Transitional.

As someone who once upon a time did everything Transitional, I will agree that making the transition (wrong choice of words?) to XHTML Strict was painful at first. But if you’re doing everything semantically and checking that your work validates to W3C, you will start to see a big improvement in the way you construct your code. Because the first task should be to implement the site’s purpose, and worry about how it’s presented later.

At the end of the day, if your goal is to deliver the most web standards compliant web site possible (and why shouldn’t it be?), XHTML Strict is the way to go.

Who is That Web Guy?

Michael is a veteran web designer / developer / usability evangelist, practitioner of W3C guidelines, and currently head of the web dev unit at Stormbox, a branding and creative communications agency located in Perth, Western Australia.

11 Responses to Why you should be using XHTML Strict

  1. Carerra Davis says:
    LOL @ HTML lazy. Strict DTD forces the browser to its highest standards mode too.
  2. Sarah says:
    Everything you said is true but I think transitional is fine for when you want to keep compatibility with browsers that have low standards support like ie6. I know ie6 sites work in strict mode but it’s a lot easier to design for using transitional.

    I love this design and noticed you’re not supporting ie6. Is this because you went strict and it was too hard to support?
  3. That Web Guy says:
    Thanks Sarah. I decided not to support IE6 only because it’s a dated non-compliant piece of junk that doesn’t deserve my time. I have the luxury of that choice when it’s my own site :-)
  4. CSS Babe says:
    What ever you say oh master!
  5. Andre says:
    Thanks for one of the best explanations I’ve read on the subject.
  6. Branigan says:
    Makes sense but you’ve given me no compelling reasons to stop using transitional. What about backwards compatibility? I thought strict has a harder time working properly on older browsers?
  7. Liv says:
    I don’t know how much of this is true: that coding on XHTML Strict will need less CSS hacks, rather than coding on XHTML Transitional; I just recently passed on Strict.

    The important thing that it’s separating the content from the structure.
  8. Jason Fowler says:
    xhtml 1.1 ftw … only problem with xhtml 1.1 is that you need a different mime-type for it to validate and IE6 & 7 don’t support that mime-type, so you need to do some sniffing before sending them the data with a “application/xhtml+xml” mime-type header.
  9. Frank says:
    Maybe so, but Strict is still the way to go.
  10. Spot on says:
    Thanks for saying what I can’t seem to get into some designers heads. Listen up people – transitional is only for when you’re making the transition (hence the name) from older mark-up practices to the newer mark-up. It’s an OK choice if your new to web design but seasoned veterans have no excuse.
  11. Sarah says:
    I recently started doing everything xhtml strict but not out of choice. The lead designer at my new job enforced it and at first I wasn’t happy but now I see it’s a much better way to code.

    I have to keep checking the validator though but there are less and less errors every time. I might end up being pretty good at this sort of thing one day.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

9 − = five