Skip to Main Content
Creating a Website: The Missing Manual, 3rd Edition
book

Creating a Website: The Missing Manual, 3rd Edition

by Matthew MacDonald
May 2011
Beginner content levelBeginner
584 pages
17h 42m
English
O'Reilly Media, Inc.
Content preview from Creating a Website: The Missing Manual, 3rd Edition

The HTML Document

So far, you’ve been considering HTML snippets—portions of a complete HTML document. In this section, you’ll learn how to put it all together and create your first genuine web page.

The Document Type Definition

In the early days of the Internet, web browsers were riddled with quirks. When people designed web pages, they had to take these quirks into account. For example, browsers might calculate the margins around floating boxes of text in subtly different ways, causing pages to look right in one browser, but appear odd in another.

Years later, the rules of HTML (and CSS, the style sheet standard you’ll consider in Chapter 6) were standardized in more detail. Using these new rules, every browser could display the same page in exactly the same way. But this change caused a serious headache for longstanding browsers that had lived through the dark ages of HTML, like Internet Explorer. These browsers had to somehow support the new standards, while still being able to properly display existing web pages—including those that relied on old quirks.

The web community settled on a simple solution. When designing a new, modern web page, you indicate this fact by adding a code called a document type definition (DTD) or doctype, which goes at the very beginning of your HTML document (Figure 2-6).

The document type definition (DTD) is the first piece of information in an HTML file. It tells the browser what markup standard you used to write the page.

Figure 2-6. The document type definition (DTD) is the first piece of information in an ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Creating a Website: The Missing Manual, 4th Edition

Creating a Website: The Missing Manual, 4th Edition

Matthew MacDonald
Learn to Build a Website

Learn to Build a Website

Cassidy Williams, Camryn Williams

Publisher Resources

ISBN: 9781449306823Supplemental ContentErrata Page