Saturday, January 16, 2010

XHTML Tutorial




• Part 1 - Introduction
• Part 2 - XHTML Tags
• Part 3 - Attributes

INTRODUCTION :

Although many people have never heard of it, XHTML is really the future of the internet. It is the newest generation of HTML (coming after HTML 4) but has many new features which mean that it is, in some ways, like XML. In this tutorial I will explain how XHTML differs from HTML and how you can update your pages to support it.

Note: It is necessary to already have a basic understanding of HTML before reading this tutorial as it deals with the differences between XHTML and HTML.

What is XHTML

XHTML stands for eXtensable HyperText Markup Language and is a cross between HTML and XML. XHTML was created for two main reasons:
1. To create a stricter standard for making web pages, reducing incompatibilities between browsers
2. To create a standard that can be used on a variety of different devices without changes

The great thing about XHTML, though, is that it is almost the same as HTML, although it is much more important that you create your code correctly. You cannot make badly formed code to be XHTML compatible. Unlike with HTML (where simple errors (like missing out a closing tag) are ignored by the browser), XHTML code must be exactly how it is specified to be. This is due to the fact that browsers in handheld devices etc. don't have the power to show badly formatted pages so XHTML makes sure that the code is correct so that it can be used on any type of browser.

XHTML is a web standard which has been agreed by the W3C and, as it is backwards compatible, you can start using it in your webpages now. Also, even if you don't think its really necessary to update to XHTML yet, there are three very good reasons to do so:
1. It will help you to create better formatted code on your site
2. It will make your site more accessable (both in the future and now due to the fact that it will also mean you have correct HTML and most browsers will show your page better)
3. XHTML is planned to replace HTML 4 in the future

There is really no excuse not to start writing your web pages using XHTML as it is so easy to pick up and will bring many benefits to your site.

No comments:

Post a Comment