W. Frank Steely Library

[Skip to Navigation]

Style Guide [part 1]

The Difference Between HTML and XHTML: An Overview

Think of XHTML as a rarified form of HTML. There is really very little new here. In fact, the code may look stripped down and simplified. The reason it looks that way is because it is.

Back in the old days, Web pages were made with simple text editors and tested in browsers. Due to certain deficiencies in browsers, specifically the lack of support for CSS, sophisticated page layouts had to be constructed with tables. While tables were developed for tabular data, they became accepted as the basis for page layout. Complicated table layouts, often with multiple nested tables, made HTML WYSIWYG editors necessary. The problems with tables used for layout are as follows:

The New Stuff

If you've made Web pages before, the only tags that may be new to you are <div> and <span>. Think of the tags <div> and its associated end tag </div> as a container. The <span> tag is similar to <div> but it is used to surround a portion of text for special formatting. These containers replace tables used for layout.

In order for a format to be associated with a <div>, a class= or id= attribute is added like in this example <div class="classname">. Classes refer to styles that are used multiple times while ids are only used once on a page. The styles associated with a class or id are designed by the Web administrator and placed in a style sheet. When a style sheet containing the commands to format class="classname" is linked to the Web page, the <div> becomes formatted. What this looks like in the style sheet isn't important for our current purposes.

Otherwise, the basic differences Between HTML and XHTML are as follows:

Tools Needed to Edit Valid XHTML

All you need is a simple text editor, like Windows Notepad, and a Web browser. Don't be afraid! You are being liberated! You need to learn a few commands but this will put you in control of your Web pages. Here's why you may not use programs that can create HTML documents:

There are some minor drawbacks to editing pages with Notepad such as lack of a spell checker. Why not cut and paste the content into a program with a spell checker and adjust as needed. Sure, it's inconvenient. But is it worth it to ensure accessibility to all? Keep in mind, making accessible Web pages isn't just the right thing to do, it's also the law.

[« previous] [next »]

updated: Saturday, 20-Aug-2005 16:48:08 EDT


This message is only visible to text browsers and non-standards compliant graphical browsers. If you are using a graphical browser, you may want to consider an upgrade. While layout and styles are hidden from non-standards compliant browsers, content is available to all. To learn why we do this, view our Accessibility Statement.