HTML and CSS  Home HTML and CSS Articles Comprehensive Guide to Xhtml
rss

Comprehensive Guide to Xhtml

Author: Unbinded.net More by this author


Comprehensive Guide to XhtmlPART I: Introduction

(Note: i am assuming you already know html)

Since some time, the internet has been relying on HTML... or Hyper Text Markup Language... Since it's been invented, many tries to replace it have been thought up, but none as successfull as XHTML (eXtensive Hyper Text Markup Language)... let's say that it's HTML cleaned up...

oh yeah... it's kinda like a combination of XML and HTML... so... there's that

PART II: The Rules of XHTML

As you may (or may not now)... XHTML uses TAGS to work (like HTML before him)... these tags have this look:

<tag property="attribute">Content</tag>

This would be the opening tag (with the properties and attributes) the stuff inside the tag, and the closing tag (so it knows when it's done with that tag)...

some tags (like "img" or "br") require no content, so they don't use a closing tag, in XHTML they close themselves ("/" is the closing character) Example:

  <img src="image.jpg" alt="text" />
<br />

ALL XHTML must begin and end with the  <html></html> tags (and all tags and their properties should be in lowercase).

The document has two main parts:

<head></head> (where you put info about the page, but not the actual content)
<body></body> (the content of the page)

XHTML requires everything done perfectly (it's very strict)... for example, when you open and close tags:

<h5><b> This is wrong </h5></b>
<h5><b> This is not wrong</b></h5>

Another XHTML rule is that all attributes are QUOTED

<img src=image.jpg alt=hello /> WRONG!
<img src="image.jpg" alt="hello" /> RIGHT!!

XHTML also requires you to state wich type of document it is (before the html tag):

W3C DOCTYPE Declarations


List Of Doctype Declarations

So... if you plan to move from HTML to XHTML, take notice of all these things.

PART III: Ending

to validate your Markup (HTML or XHTML) go to:

the W3C validation service

I hope this was usefull for those of you that use HTML already, and more usefull for those who want to take a peak at the world of Markup Languages.


Rate this Material: Bad 1 2 3 4 5 Excellent
print this page tell a friend subscribe to newsletter subscribe to rss

Add comments to "Comprehensive Guide to Xhtml"