webmaster resources free resources at triphp
Resources  •  Marketplace  •  Forums  •  Hosting  •  TriPHP Blog  •  Contact Us
spacer image


XHTML Introduction
by Ramil Alcibar

Some webmasters doesn’t bother looking and verifying their website’s code resulting in what we called as “bad” HTML. As long as they see what they want in a page, then it will be OK for them even if it contains some errors like missing out a closing tag. With this, XHTML come to the rescue. XHTML stands for stands for EXtensible HyperText Markup Language. XHTML is a combination of HTML and XML (EXtensible Markup Language). It consists of all the elements in HTML 4.01 plus the syntax of XML. This is the stricter and cleaner version for making web pages, reducing incompatibilities between different types of browsers.

Why XHTML?
Consider the following code:





Body content, something’s missing!!!

If you view it in your browser, it will be displayed correctly. However there’s something wrong in that code. Can you guess what? Yes, it’s the closing of

tag. The correct code for that will be





Body content, something’s missing!!!



but take note that it has still missing, the DOCTYPE. It was just meant to correct the above code.

With XHTML, you have the following benefits:

  • XHTML is a W3C Recommendation. A W3C Recommendation means that the specification is stable and is now Web standard.
  • A cleaner and better formatted code enabling handheld devices to view your pages correctly.
  • XHTML is aimed to replace HTML

XHTML Basic Structure
XHTML document just consist of three main parts. Take a look below.






...

These three parts are the DOCTYPE, head, and the body.


Source URL: http://www.triphp.com

About The Author
Ramil Alcibar is a contributor to TriPHP Webmaster Resources.