Introduction Basic Structure Cascading Style Sheets Text Formatting Lists Links Tables Images Forms Frames Appendix - XHTML Elements Site Home

XHTML Reference Guide

Introduction

XHMTL is the next flavour of HTML following on from HTML 4.01. In this guide, XHTML 1.0 Standards as defined by the W3C (World Wide Web Consortium) are adhered to. In conjunction with these standards, a summary of which can be seen below, a strict interpretation of XHTML is followed where possible. This includes the avoidance of deprecated elements and attributes and the use of Cascading Style Sheets (CSS) for font, colour and layout settings.

A deprecated element or attribute is one that has been have been superseded by other more functional or flexible alternatives. Browsers should continue to support deprecated elements and attributes, but eventually they are likely to become obsolete and so future support cannot be guaranteed.

This isn't a guide for CSS, but where an element or attribute is now deprecated, the style sheet equivalent will be shown. There is a chapter on CSS which provides the basics for forming style rules. For more information on the subject, see the Cascading Style Sheets guide.

This XHTML guide only provides a quick reference to (X)HTML. It is divided into a number of topics which can be navigated to by using the menu bar at the side of the page.

Browsers

A little word about browsers before continuing. Despite the efforts of the W3C we are unfortunately left entirely in the hands of the browser providers. Many browsers are not fully compliant with the W3C standards and amongst those that are, some standards are interpreted slightly differently. This is not so much of a problem with HTML itself but is a big big problem where style sheets are concerned and also with script support.

There are several browsers on the market, the major ones being Microsoft's Internet Explorer(IE), Mozilla, Mozilla Firefox, Netscape and Opera. Of these by far the most popular one is currently Internet Explorer, purely for marketing reasons not performance, and unfortunately, out of these major players, Microsoft is the worst offender in respect of following standards.

Because of its big hold on the market, websites should be designed with Internet Explorer in mind. But don't use IE to develop your page! It is best to use a standards-compliant browser and then tweak it for IE. The advantage of this is that you can see how the page actually should look before massaging it into shape for IE and it also future proofs it for the time that IE is standards compliant (IE7 maybe?)

Also, just for everyday browsing, each of the other browsers mentioned above has big advantages over IE. Of these browsers, the newest kid on the block, Mozilla Firefox, is the recommendation. It is easy to install, easier to use than IE, a lot more secure, has a load of really useful add-ons and of course it's free.

Get Firefox!

Validation

Validating your XHTML is very important and there's no reason not to do it. If your page isn't behaving as expected it may be a closing tag missing, an attribute name typed incorrectly or whatever. Validation ensures that any problems are not down to the XHTML. And once you're sure that the XHTML is correct then validate your style sheets. There are a few sites which offer validation giving you various options of referencing the code. The following table summarises these options for a couple of sites.

  Code referenced by
Site Address Type URL Local copy   copy/paste
W3C http:validator.w3.org XHTML a tick a tick
http://jigsaw.w3.org/css-validator/ CSS a tick   a tick
WDG http://www.htmlhelp.com/tools/validator/ XHTML a tick a tick a tick
http://www.htmlhelp.com/tools/csscheck/ CSS a tick a tick a tick

W3C - World Wide Web Consortium
WDG - Web Design Group

Summary of XHTML 1.0 Standards

Get Out Clause

Although every effort has been made to guarantee the accuracy of this guide, there may be the odd porky or ambiguity and so if anyone finds any glaring errors please email me and let me know.


Valid XHTML 1.0! Valid CSS2