Spread the word

Wednesday, December 22, 2010

Difference Between XHTML and HTML4

HTML is the Hyper Text Markup Language which is rendered by any web browser you use to visit any website or web application. Whatever programming language, whatever platform a website or web application uses, it drills down to HTML only for your browser. So HTML is the building block of the World Wide Web which has not seen much significant improvement during last 2 decades except the Extensible Hyper Text Markup Language - the XHTML.

Here are the very basic differences between HTML and XHTML -

1) All documents must be well formed and properly nested

<p>The food is <em>delicious</em></p> - Correct.
<p>The food is <em>delicious</p></em> - Wrong.

2) Elements and Attributes must be in lowercase

<li> will be used instead of <LI> and the two are much different - Correct.

3) XHTML Documents and every content section must have one container


<p>The food is delicious</p> <p>I am hungry</p> - Correct.
<p>The food is delicious</p> I am hungry - Wrong.

4) Attribute values must be quoted

<td rowspan="3"> - Correct
<td rowspan=3> - Wrong

5) Empty Elements must either have an end tag or the start tag must end with />

<hr></hr> or <br /> <hr /> - Correct
<br> <hr> - Wrong.

Though at the end of the day we have a new player in the game which is being called as HTML5 - a wonder in HTML technology, the movement World Wide Web should have seen much ago.


Zeon said...

Hi ,
I just wanted to invite you to the indiblogger meet happening in Kolkata after 2 years at
DC-36, Sector - 1, Salt Lake City
Kolkata - 700 064
Landmark: Behind City Centre.
Only 200 seats available. Entry is free with loads of fun. If you have not registered already, register here = http://www.indiblogger.in/bloggermeet.php?id=113 . See you there!

Post a Comment