This is something I wrote several years ago, for CSc 473. I am putting back a link to it, by popular demand, in 221.
HTML was intended as a markup language, meaning that we can specify the general characteristics of parts of a document, such as headings, paragraphs, lists, tables, etc. It was never intended as a page layout language.
Over the years, clever people have devised approximately a zillion ways to trick HTML into acting like a page layout language. Tables were used, not for tabular data, but to structure a page. (Yes, I'm guilty. I have a lot of rework to do on this site.) Others used a 1x1 pixel transparent GIF to insert between lines to get the extra spacing that HTML does not provide a mechanism to get.
This is a dead end. The trickiness is about to collapse under its own weight, and changes on the horizon make it a disaster:
Not at all. XML is a big subject, and so are Cascading Style Sheets (CSS). The serious student will eventually want to know both thoroughly, but fortunately we can get started on the right road by following some relatively simple rules.
In short, and somewhat oversimplified, XHTML is just HTML written according to the syntax rules of XML. There is more, but if we do that much, and use Cascading Style Sheets, we will have HTML that most modern browsers can handle with no difficulty, and which will be ready for the new devices that are rapidly approaching.
The essential core of a well-formed HTML page is:
<html>
<head>
<title>Title Here
(Required)</title>
link to external style sheet
(optional)
<style>
styles that
apply to this one document
</style>
</head>
<body>
The text of the page, with optional
local style controls.
</body>
</html>
The "Cascading" in "Cascading Style Sheets" comes from the way we can specify an external style sheet, but perhaps override it with styles that apply only to the one document, and perhaps override both of them with style local to a particular element such as a paragraph.
Look at the source for this page and you will see all three.
And with that, dear readers, I have run out of time. I'm going to publish this, knowing that it is preliminary and has not been checked by more knowledgeable people, because some of you asked for it, and to get feedback. If you see errors or hopelessly unclear passages, send mail!
The exposition will continue with an explanation of how CSS was used in producing this page.