indiWiz.com
SiteSearch:
Jump:

Site Map | WizTools.org | jCraze Blog
Web Developer's Den!
Home : WDD : html
This Article...
Print Version
Add Comment
View Comments
html
HTML Primer 1
HTML Primer 2
Hyperlinks
Color Guide 1
Color Guide 2
Fonts in HTML
HTML Lists
Table Tutor 1
Table Tutor 2
HTMLfx
HTML Special Characters
HTML Editors
Animation and HTML
XHTML - The Bare Facts
Sections

Commniquè
Sign Guestbook!
Read Guestbook!
MailMe!

XHTML

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

    1. XHTML is case sensitive. All tags & their attributes must be in lowercase.

    2. 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 />.

    3. Tags should be properly nested.

      Wrong: <p><i>Subhash</p></i>
      Correct: <p><i>Subhash</i></p>

    4. Attributes must be quoted, and must contain some value.

      Wrong: <p align=center />
      Correct: <p align="center" />

    5. Attributes cannot be minimized.

      Wrong: <option selected>
      Right: <option selected="true">

    6. 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:

    1. <img> tag SHOULD have 'alt' attribute.

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


User Comments

Add Comment

[Quick Stats: Number of main threads: 0, Number of sub-threads: 0]

Sign Guestbook | Who is Subhash?
The contents of this site are copyright© 2000-2008, indiWiz.com. All Rights Reserved.