views:

133

answers:

6

Hi,

I was wondering if it was considered more professional to write a website in strict xhtml rather than transitional.

Is it something that should be done as you advance as a web developer, or is it irrelevant?

A: 

On the marketing side, you might get a slightly better response for saying that you right in strict XHTML, but really, the choice doesn't matter. Transitional has some quirks that improve backwards compatibility with elements from HTML4 and older, but which have since been disfavoured and thus deprecated in the strict flavours (e.g., frames). If you're learning how to write markup these days, you're learning all XHTML anyway, so you can feel free to use strict.

Short answer: it doesn't matter.

Steven Xu
Marketing side? Really? W3 has stopped advancing XHTML. You should too! Here's why: HTML4.01 is closer to the syntax for HTML5, so it'll be an easier transition when it's time. Now, get out of our way, Microsoft.
bpeterson76
@bpeterson76: http://www.w3.org/TR/html5/the-xhtml-syntax.html#the-xhtml-syntax
David Dorward
http://www.w3.org/News/2009#item119
bpeterson76
+5  A: 

With the possible exception of the (rarely needed) start attribute, the difference between Strict and Transitional boils down to "Things you should not have used since Netscape 4 stopped being a dominant browser".

So, the question is a tricky one as, if you learned HTML this side of the millennium, you shouldn't have been using Transitional in the first place (now let us have a minutes silence as we lament the poor quality of over-popular tutorials (such as one from an organization that gets a lot of glory reflected off the W3C due to its similar name … and I'm ranting, so I'll stop now).

David Dorward
A: 

Here is an article I found yesterday. Read the markup part, its the first part :D http://davidwalsh.name/get-over-it

Wai Wong
Hey, feel free to write invalid markup, more money and jobs for those of us who actually care to write good code. Plus, more money for the SEO guys that hire us to fix the mess people who didn't care left behind. Just because Dojo might use non-standard tags (and ARIA is another example) it doesn't give us all license to start ignoring the standard and dropping end tags randomly. They exist for a reason.
bpeterson76
A: 

I write HTML 4.01, either traditional or strict.

The truth is XHTML is broken and a correct rendering on a HTML 4.01 browser will litter your page with right angle brackets.

If you think you know how <br/> is defined in the HTML 4 standard, think again.

 This sentence is <br/> across two lines.

When read by a strict parser becomes

 This sentences is
 > across two lines.

The SGML language form which HTML is built on has a shorttag feature known as NET. The transformation is "<br /" -> "<br></br>". So, "<br/>" burns.

Joshua
Isn't `<br />` correct anyway?
Platinum Azure
This has nothing to do with the question.
Alohci
@Platinum, no it isn't.
Joshua
@Joshua: I thought it was in XHTML... maybe that's our problem, if you're talking about HTML 4.01 still.
Platinum Azure
The problem is the supposed backwards compatibility of XHTML to HTML 4 doesn't exist.
Joshua
@Joshua: I've never had a problem as long as you write <br />. Note the space. HTML 4 parsers read the / as an element attribute.
Zan Lynx
A: 

It doesn't make much of a difference which you use - just try to be as consistent as possible with your mark-up. If nothing else, it makes search+replace much easier.

What
A: 

If you want to be "professional" and up-to-date use <!DOCTYPE html>. This won't break anything and it's as modern as you can get.

TRiG