Chapter 3. Basic (X)HTML Structure
This chapter covers the most basic (X)HTML elements—the ones you need to create the structure of your document. You’ll learn how to create new paragraphs, headers, page breaks, comments, and more.
Creating a clear and consistent structure makes it that much easier to apply styles to your document.
Starting Your Web Page
Begin your page by using a DOCTYPE
(see page 38) 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.
To start a transitional HTML 4 page
Type <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”> ...
Get HTML for the World Wide Web, Fifth Edition, with XHTML and CSS 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.