Why you should be using XHTML Strict

Written by That Web Guy on 5th June 2009. 11 comments

Why you should be using XHTML Strict
  • Avant Innovations
  • Advertise Here

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.

Is this worth sharing?

That Web Guy

About That Web Guy

That Web Guy (Mikey to his friends) is a veteran web designer based in Perth, Western Australia, and currently Design Director at Perth Web Design. When he's not XHTML'ing or messing around in Photoshop, Mikey can usually be found preaching web standards evangelism onto unsuspecting victims.

Feel free to send That Web Guy a message some time, follow him on Twitter, or make a donation.

Comments

Not a Member

Carerra Davis

LOL @ HTML lazy. Strict DTD forces the browser to its highest standards mode too.

Friday 5th June 2009 | 05:57 PM Reply Comment URL Back to top

Not a Member

Sarah

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?

Friday 5th June 2009 | 06:01 PM Reply Comment URL Back to top

That Web Guy

That Web Guy

Responding to this comment by Sarah

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 :-)

Friday 5th June 2009 | 06:04 PM Reply Comment URL Profile Back to top

CSS Babe

CSS Babe

What ever you say oh master!

Friday 5th June 2009 | 07:32 PM Reply Comment URL Profile Back to top

Not a Member

Andre

Thanks for one of the best explanations I've read on the subject.

Saturday 6th June 2009 | 03:22 PM Reply Comment URL Back to top

Not a Member

Branigan

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?

Sunday 7th June 2009 | 09:55 AM Reply Comment URL Back to top

Not a Member

Liv

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.

Sunday 7th June 2009 | 08:49 PM Reply Comment URL Back to top

Jason Fowler

Jason Fowler

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.

Monday 8th June 2009 | 10:46 AM Reply Comment URL Profile Back to top

Not a Member

Frank

Responding to this comment by Jason Fowler

Maybe so, but Strict is still the way to go.

Monday 8th June 2009 | 05:30 PM Reply Comment URL Back to top

Not a Member

Spot on

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.

Friday 19th June 2009 | 08:58 PM Reply Comment URL Back to top

Not a Member

Sarah

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.

Monday 21st December 2009 | 10:55 AM Reply Comment URL Back to top

FYI: You are currently not logged in. It's cool though - you can still comment. But only members get a profile page, access to the download section and they can pimp their own web sites. Feel free to register or Login now!

Your name:

Your comments:

Note: HTML tags are automatically stripped from comments.

Are you human?
Turing

Sorry, I have to ask. So what sort of animal is this? (Hint: you don't have to be perfectly specific)

Back to top

Login to That Web Guy Blog

Login

Not registered? | Forgot your Password? Cancel Login