Share
Explore BrainMass

concepts involved in the design of web pages

One recent change in web design is the shift in standards from HTML to XHTML. Describe how a web designer defines a page as "XHTML" as opposed to "HTML" and identify two different types of XHTML standards. What are the differences between these two standards?

Solution Preview

The Most Important Differences:
XHTML elements must be properly nested
XHTML elements must always be closed
XHTML elements must be in lowercase
XHTML documents must have one root element

XHTML Elements Must Be Properly Nested
----------------------------------------
In HTML, some elements can be improperly nested within each other, like this:

<b><i>This text is bold and italic</b></i>

In XHTML, all elements must be properly nested within each other, like this:

<b><i>This text is bold and italic</i></b>

XHTML Elements Must Always Be Closed
-------------------------------------
Non-empty elements must have an end tag.

This is wrong:

<p>This is a paragraph
<p>This is another paragraph

This is correct:

<p>This is a paragraph</p>
<p>This is another paragraph</p>

Empty Elements Must Also Be Closed
------------------------------------
Empty elements must either have an end tag or the start tag must end with />.

This is wrong:

A break: <br>
A horizontal rule: <hr>
An image: <img src="happy.gif" alt="Happy face">

This is correct:

A break: <br />
A horizontal rule: <hr />
An image: <img src="happy.gif" alt="Happy face" />

An XHTML document, in the main, doesn't appear all that radically different from a "normal" HTML element (see Listing 1). The root of such a document is still an <html> node, the document is divided into a <head> and <body> section, and the tag usage is consistent with what has been produced in HTML editors or by hand for the last decade.

However, you will notice some differences. The first has to do with the fact that this is an XML document. It contains the processing instruction <?xml version="1.0" encoding="UTF-8"?>, which both tells the parser that it is an XML document and that it uses the standard 8-bit encoding schema of most typical English documents.

The document's DOCTYPE declaration is likewise a little ...

Solution Summary

This job highlights concepts involved in the design of web pages.

$2.19