What is the difference between HTML and XHTML?

He has: 71 posts

Joined: Nov 2006

what is the difference between html and xhtml?

Busy's picture

He has: 6,151 posts

Joined: May 2001

As of last month XHTML was the next version of HTML, this month however it's anyones guess as they are talking about bringing out HTML5 (xhtml replaced html at 4.01)

He has: 71 posts

Joined: Nov 2006

does that mean that html and xhtml are the same thing in sense that ie6 is the same thing as ie7???

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

The Coder;211020 wrote: does that mean that html and xhtml are the same thing in sense that ie6 is the same thing as ie7???

No, not really. It's more like, say, the difference between Firefox and other mozilla-based projects (like Flock for example). It's all based on the same thing but HTML and xHTML are going in two slightly different directions.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Megan;211033 wrote: It's all based on the same thing but HTML and xHTML are going in two slightly different directions.

They aren't even based on the same thing: HTML is an SGML application, while XHTML is HTML reformulated as an XML application. Of course, they're both specified by the same people, and used for hypertext markup.

With HTML 5, they may go in the same direction after all. It remains to be seen.

Smiling

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

xHTML is really a way of transitioning towards XML. xHTML is essentially HTML with a stricter syntax (because in XML you can't get away with any mistakes).

There is some debate in the web design community about whether you should use an HTML or xHTML doctype. Here are a couple of references:

HTML vs. xHTML from the Web Standards Project
Sending xHTML as HTML considered harmful
Sending xHTML as HTML considered harmful to feelings (counterpoint to above)

He has: 71 posts

Joined: Nov 2006

thanks for clarification.....

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.