Sponsered Links
Categories
Sponsered Links

Introduction to XHTML

 

Pre Knowledge Required

  • HTML
  • Basics of Build Web Pages

About XHTML

  • XHTML stands for Extensible HyperText Markup Language
  • XHTML is same as HTML 4.01
  • XHTML is a advance version of HTML
  • HTML defined as an XML application is called XHTML
  • XHTML is a combination of HTML and XML

XHTML Tags

  • XHTML tags must be closed
  • XHTML documents must be "properly nested"
  • XHTML tags must be in lowercase characters
  • Attribute names must be in lower case
  • Attribute values must be quoted
  • Attribute minimization is forbidden
  • The id attribute replaces the name attribute
  • The XHTML DTD defines mandatory elements

     XHTML Tags must be closed

Wrong way:
<p>This is a paragraph
<p>This is another paragraph
Correct way:
<p>This is a paragraph</p>
<p>This is another paragraph</p>

XHTML document must be properly nested

Wrong way:
<b><i>bold and italic tags</b></i>

Correct way:

<b><i>bold and italic tags</i></b>

XHTML tags must be in lower case:

Wrong way:
<BODY>
<P>This is a paragraph</P>
</BODY>

Correct way:

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

Attribute names must be in lower case

Wrong way:
<table WIDTH="100%">

Correct way:

<table width="100%">

Attribute values must be quoted

Wrong way:
<table width=100%>

Correct way:

<table width="100%">

Attribute minimization is forbidden

Wrong way:
<input checked>
<option selected>
Correct way:
<input checked="checked" />
<option selected="selected" />

The id attribute replaces the name attribute

Wrong way:
<img src="image.gif" name="image" />

Correct way:

<img src="image.gif" id="image" />

The XHTML DTD defines mandatory elements

<!DOCTYPE Document Name>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Title Name</title>
</head>
<body>
</body>
</html>

 
 
Sponsered Links
Latest Updates
 
All Content of this site is for learning only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright © 2009 JSPSERVLETTUTORIAL.INFO All Right Reserved