XHTML->eXtensible Hyper
Text Markup Language.
To be brief, XHTML is HTML defined as an XML application.
The main advantage of XHTML is that new custom tags can be added by modifying the required DTD.
XHTML is not loosely constructed as HTML. Some important rules you have to follow:
XHTML is case sensitive. All tags & their attributes must be in lowercase.
Every opening tag must have a closing tag. If there is any tag,
say <p></p> without anything
inbetween, same can be written as <p />.
Another example is <br>, which
should be written as <br />.
Tags should be properly nested.
Wrong: <p><i>Subhash</p></i>
Correct: <p><i>Subhash</i></p>
Attributes must be quoted, and must contain some value.
Wrong: <p align=center />
Correct: <p align="center"
/>
Attributes cannot be minimized.
Wrong: <option selected>
Right: <option selected="true">
Name attribute is replaced by id.
Wrong: <img src="img/trial.png" name="subhash">
Right: <img src="img/trial.png"
id="subhash">
Other rules regarding specific tag attributes:
<img> tag SHOULD have 'alt' attribute.
<style> tag SHOULD have 'type' attribute.
Every XHTML page should have a DOCTYPE declaration.
For Stylesheet Formatted Page(Strict):
<!DOCTYPE htmls PUBLIC "-//W3C//DTD XHTML
1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/strict.dtd">
For HTML Formatted Page(Transitional=Strict+Presentation Tags):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
For Frameset Page(Frameset=Transitional+Frame Tags):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/frameset.dtd">
The structural order of an XHTML page must be:
<!DOCTYPE html><html><head><title></title></head><body></body></html>
As said earlier, every opening tag must be closed.