Extensible Hypertext Markup Language

What is xhtml?

XHTML is the cleaner and stricter version of HTML. It was started in 2000 with version XHTML1.0 . XHTML 1.1 comes into existence in 2001. Its very much similar to HTML 4.0.

Doctype of XHTML 1.0

Way to write Doctype of XHTML 1.0



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
		
		

Doctype of XHTML 1.1

Way to write Doctype of XHTML 1.1

						
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

		

Difference in XHTML

XHTML is different from HTML 4.0 in many ways. Like,

Except last three, all rules are followed in HTML5


<DIV> </DIV>              //wrong in XHTML.
	use <div> </div>      // right

<img src="" alt=""> is wrong in XHTML.
	use <img src="" alt="" />

<br> is wrong in XHTML.
	use <br />

<img src="" alt="" width=200> is wrong in XHTML.
	use <img src="" alt="" width="200" />

<p>This para is <b>bold</p></b> is wrong in XHTML
	use <p>This para is <b>bold</b></p> 
	
<input type="text" disabled />                // wrong
<input type="text" disabled="disabled" />     // right