resumevivek.com eye
About Me | My Portfolio | My Blogs | My Photos | Contact Me
“Instead of worrying about what you dont have,
make the very most of what you do have.”
“Creative thinking is not a talent, it is a skill that can be learnt.
It empowers people by adding strength to their natural abilities
which improves teamwork, productivity and where appropriate profits.”
Home > My Blogs
My Blogs
     
CSS Tutorials
Xhtml / Html Difference ?
Web 2.O
Whats new in CSS 3
Html 5
 
Xhtml and Html Difference

The most important difference between Xhtml and Xhtml :
HyperText Markup Language (HTML), is an application of SGML (Standard Generalized Markup Language), and allows to omit certain tags.

The Extensible HyperText Markup Language (XHTML), is an application of XML (Extensible Markup Language). It doesn’t permit the omission of any tags. Xhtml provides a shorthand notation for empty elements: For eg: we could use <br/> instead of <br></br>.

The Most Important Differences:

  • XHTML elements must be properly nested
  • XHTML elements must always be closed
  • XHTML elements must be in lowercase
  • XHTML documents must have one root element


XHTML Elements Must Be Properly Nested

Following example for improper nesting :
 <b><i>This text is bold and italic</b></i> 

Following example for proper nesting :
 <b><i>This text is bold and italic</i></b> 


XHTML Elements Must Always Be Closed

Wrong Method:

<p>This is a paragraph
<p>This is another paragraph

Correct Method

<p>This is a paragraph</p>
<p>This is another paragraph</p>


XHTML Elements Must Always Be Closed

Wrong Method:

A break: <br>
A horizontal rule: <hr>

Correct Method

A break: <br/>
A horizontal rule: <hr/>


XHTML Documents Must Have One Root Element

<html>
<head> ... </head>
<body> ... </body>
</html>

 
About Me | My Portfolio | My Blogs | My Photos | Contact Me
Email: resumevivek@yahoo.com