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
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>
|