I propose to consider the question: Can machines think?.” Alan Turing
A resource for web developers a code snippet library with step by step tutorials.

a niche content web resource for geeks

       

Search Amazon

XHTML: Intro - an introduction to Extensible Hypertext Markup Language


What is Extensible Hypertext Markup Language (XHTML)?


Or you can skip this Intro and go straight to the code examples on the XHTML: Basics page.


As a website developer you should be knowledgeable in XHTMLExtensible Hypertext Markup Language as well as in HTMLHypertext Markup Language. The good news is that XHTML uses the vocabulary of HTML and as XHTML is a subset of XMLExtensible Markup Language you will be creating pages that can be read by XML enabled devices.


Different methods of accessing the Internet are constantly being introduced: mobile devices including phones and personal digital assistants (PDAs). XML can be extended by the user agent developers to accommodate these new devices and coding in XHTML now will ensure forward compatibility.


Your goal should be to separate the content of the page from the presentation or style. XML is a language that describes data and not how that data should be presented to the user. There is an interesting short film on YouTube at present made by Michael Wesch of Kansas State University called wwwWeb 2.0... The Machine is Us/ing Us which describes the essence of the separation of content and presentation which the film names as content and form. This idea was introduced with HTML and Cascading Style Sheet (CSS) language. XHTML carries this process a step further and relies on CSS to separate the presentation from the content. XHTML is therefore much stricter than HTML and requires that you write 'well-formed' code.

 

The basic rules for writing well-formed XHTML are:

 

All XHTML documents must declare a Document Type Definition (DTD)

 

All XHTML elements and attributes should be written in lower-case characters

 

Each page must have one root element: <html></html>

 

The <head></head> and <body></body> elements must also be included

 

All non-empty elements must contain an opening (start) and a closing (end) tag: <h1></h1>

 

All empty elements must be closed or the opening tag must have the format: <br />

 

All attributes must be surrounded with double quotes: id="myid" or single quotes: id='myid'

 

Always use the 'alt' and 'title' attributes for images

 

All elements must be nested correctly for example <p><em></em></p> and not <p><em></p></em>

 

All content must be wrapped in an element: for text content at least use <p>Content</p>

 

A unique 'id' attribute has replaced the use of the 'name' attribute. (But use both for compatability.)

 

Attribute minimization is not allowed: so for a form's radio button not 'checked' but

'checked="checked" '

 

Always use a special character's entity value, for example: the ampersand '&' value is '&#38;'

 

Do not use HTML 4 deprecated elements that describe style: such as <font></font>

 

 

These rules in action are described with code examples in XHTML: Basics.

 

 

The official World Wide Web Consortium (W3C) specification for XHTML 1.0 can be found at wwwhttp://www.w3.org/TR/xhtml1/

 

 

Bookmark and Share

 

Copyright © 2006-2010 justfigures.co.uk