Starting Your Web Page

Begin your page by using a DOCTYPE (see page 40) to declare what type of HTML or XHTML you’re using. The DOCTYPE lets browsers know what to expect and tells validators how to judge your code in order to check its syntax. Then, signal the beginning of the actual code with the opening html tag.

Figure 3.1. Here’s the DOCTYPE for a transitional HTML document as well as the opening and closing html tags. It’s a gruesome bit of text. I recommend just copying it from one document to the next instead of trying to type all that gobbledy-gook.

To start a transitional HTML 4 page:

1.
Type <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML ...

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.