Difference Between HTML & XHTML
Tagged in , , and posted in Design Resources

When choosing between HTML and XHTML both are Markup languages and used to change the way on how your CSS box modeling appearances, the main difference between them is that XHTML has less attribute than HTML for example in XHTML you can use <br/>instead of <br></br> used by HTML which require an end tag for every start tag , choosing between HTML and XHTML depends of your browser technologies and devices used whether it is a mobile phones or other small devices which can be impacted by a bad markup language therefore by combining HTML and XML , XHTML ( Extensible Markup Language )was been developed !

The main difference between both Markup languages :

DOCUMENT STRUCTURE

XHTML DOCTYPE is mandatory
The XML namespace attribute in <html> is mandatory
<html>, <head>, <title>, and <body> is mandatory

EG:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.adnankab.wordpress.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=”http://www.adnankab.wordpress.org.org/1999/xhtml”>

<head>
<title>Title of document</title>
</head>

<body>
……
</body>

</html>

XHTML ELEMENTS

XHTML elements must be properly nested

EG:
HTML :<b><i>Bold italic</b></i>
XHTML :<b><i>bold italic</i></b>

XHTML elements must always be closed

EG:

<p>This is a paragraph</p>
XHTML elements must be in lowercase

EG:

HTML:

<BODY>
<P>This is a paragraph</P>
</BODY>

XHTML:
<body>
<p>This is a paragraph</p>
</body>
XHTML documents must have one root element

XHTML ATTRIBUTES

Attribute names must be in lower case
EG:
HTML:

<table WIDTH=”100%”>

XHTML:

<table width=”100%”>

Attribute values must be quoted
EG:

HTML:
<table width=100%>
XHTML:
<table width=”100%”>

Attribute minimization is forbidden

EG:

HTML:
<input checked>

XHTML:
<input checked=”checked”>

Download HTML To XHTML converter through this link

It's only fair to share...Email this to someoneShare on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn