In this lesson
- first
Principle 4 - Is the website robust
Guideline 4.1 Maximise compatibility with current and future user agents, including assistive technologies.
4.1.1 In content implemented using markup languages, elements have complete start and end tags, elements are nested according to their specifications, elements do not contain duplicate attributes, and any IDs are unique, except where the specifications allow these features
- Use the standard code as defined by the W3C (Lesson 1 section 1)
4.1.2 For all user interface components the name and role can be programmatically determined. States, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies.
- Including multimedia in your web page (Lesson 8 section 2)
HTML or XHTML
Until recently all web pages were written using HTML (hypertext markup language), the most up-to-date version being HTML4.01. Most computer based browsers will work with quite badly written HTML code, (for example forgetting to close an element tag). However some modern devises, such as mobile phones, do not have the ability to cope with bad HTML code and produce some unexpected results. Therefore XHTML was introduced as a language that combined the benefits of HTML and XML (extensible markup language). HTML was designed to display data whilst XML was designed to describe data. This combination (XHTML) gives you the opportunity to write "well-formed" documents now, that work in all modern and future browsers but are still backward browser compatible.
In essence the current version of XHTML (XHTML1.0) is almost identical to HTML4.01. The only real differences are
- All XHTML tags must be written in lower case (<a> instead of <A>)
- All nested elements must be nested correctly (<b><i>text</i></b>)
- All XHTML tags must be closed (<p>paragraph of text </p>)
- All empty elements must be closed with the backslash (<br /> and <hr />)
- Attribute values must be enclosed with speech marks (width=”50%”)
- The id attribute should be used instead of the name attribute – however it is recommended that you use both id and name for the present. (img src="picture.gif" id="picture1" name="picture1" />)
- Attributes must be fully coded (<input checked=”checked” /> not <input checked>)
All the examples used in this course are written in HTML, but will work equally as well as XHTML examples.