Converting HTML to XHTML
XHTML is NOT a completely new language - it is simply more of a HTML makeover "XML based"
Lets begin with where the whole idea started from. There is an organization in the world - called the "W3C" (think WWW Committee). It is the W3C's responsibility to coordinates the standardisation of internet protocols.
Because the internet isn't just a book, but a living, fluid, rapid transfer of information, it has to constantly be ready for the next big change. Hence, XHTML has come about. The idea of the future of the web is that "Cascading Style Sheets (CSS) are used and moved around like applets for a Java program. These CSS style sheets are not completely dissimilar to the FRAMES you learned about in page 16. The style sheet is like a plug in page that you can substitute with other plug in pages.
The wisdom of the W3C council also yielded that we couldn't just shut down the whole internet while they were doing a transition from one system to the other - so we have a few different ways to get things worked around:
To begin with - the first line in an HTML document says <HTML>
If we aren't writing an HTML page - then it should say something else no? YES!
<?xml version="1.0" encoding="iso-8859-1"?>
It is recommended by the W3C that this "declaration" be included in all XHTML documents, however there can be problems with older browsers which may not have the ability to identify this as a valid HTML tag.
The second line in the XHTML document SHOULD be the specification of the document type. In the case of what we are doing -
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
meaning that we are doing TRANSITIONAL style - with ENGLISH language.
Afterward, you may begin typing your HTML page as you have always done in the past. It is expected that your next line should look something like this:
<html xmlns="http://www.w3.org/1999/xhtml" lang="EN">
The attribute "xmlns" is the "name-space" with which we associate the document. The attribute "lang" of course is the language - in this case ENGLISH
New rules for TAGS:
All XHTML tags and attributes MUST BE IN LOWER CASE. That means <BODY> and <Body> are wrong. It should always be written as <body>
All XHTML tags should have their end tags. Think </html> While it was expected in HTML - it was forgiving. XHTML is not so forgiving. If you open a tag YOU MUST CLOSE IT! Furthermore - even in commands that normally didn't require closing - they still need closed "internally as follows"
"Empty tags" should be ended with /> instead of >
The most commonly used "empty tags" in XHTML are:
All XHTML tags MUST be properly nested! Example: <font color="red"><i>Italicized AND red?</font></i> is wrong.
Instead it should read: <font color="red"><i>Italicized AND red!</i></font>
Rules for XHTML Attributes
On The Following Indicator...
( GREEN will indicate your current location)
|Otherwise - please click to visit an advertiser so they know you saw their ad!|