What is XHTML?
By Tyler Downer
2/9/08
All of you have seen a web page. In fact, you are looking at one right now. Have you ever considered what a web page is made of? The answer is HTML, or it's newer cousin, XHTML, the basic language for most web sites. This language tells the web browser hot to display text, images and links in a way that people can understand and is visually pleasing to the eye. In case you are wondering what the code looks like, here is the absolute simplest XHTML document possible:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Example document </title>
</head>
<body>
<p>Some text here.</p>
</body>
</html>
From this large pile of code, this is all you would see:
Some text here.
Seems somewhat wasteful. But in that document is all that a web browser needs to know about the web page, what type of XHTML it uses, what encoding it uses, where to document begins and ends and the potential for much more. Lets go over each part of the documents.
First there is the DOCTYPE. This portion comes before anything else and tells the browser exactly how to interpret the page. Then the html tag, this tells the browser that the page is begriming. Next is the head tag. This contains instructions on what the page is about, how to make it look and more. In our simple page, it only says what character set, or what type of letters and numbers it uses, and a title. That appears up at the top of the browser and is like a signpost. Then you see </head>
this means that the header is ending. Now comes the body. This holds the actual text and images that you see on the screen. It holds a <p> tag. This is a paragraph tag, meaning the start and ending a of a paragraph. Then the </body> and </html> tags come.
These close the body and html portions.
You can see how XHTML is structured. Each tag is opened, the information it contains is put is, then it is closed. The document above is extremely simple and leaves many things out that could be used, such as images. If you would like to see a real working web sites. code, you can always either right-click on the web site, then click View Source, or click View in the toolbar in your browser, then View Source. In fact do that now. Right-click on this web site, then click View Source. It will most likely be both very interesting and very confusing. You will get better at learning about how a web site looks the way it does.
Enter our new Contest today!

