O'Reilly logo

HTML, XHTML, and CSS Bible, Fifth Edition by Steven M. Schafer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. What Goes into a Web Document?

IN THIS CHAPTER

  • Specifying Document Type

  • Overall Document Structure: HTML, Head, and Body

  • Style Definitions

  • Block Elements: Markup for Paragraphs and Other Blocks of Content

  • Inline Elements: Markup for Characters

  • Special Characters (Entities)

  • Organizational Elements

  • Linking to Other Pages

  • Images

  • Comments

  • Scripts

  • Putting It All Together

HTML has come a long way from its humble beginnings. However, despite the fact that you can use HTML (and its derivatives) for much more than serving up static text documents, the basic organization and structure of the HTML document remains the same.

Before we dive into the specifics of various elements of HTML, it is important to summarize what each element is, what it is used for, and how it affects other elements in the document. This chapter provides a high-level overview of a standard HTML document and its elements. Subsequent chapters cover each element and technology in detail.

Specifying Document Type

One attribute of HTML documents that is frequently overlooked is the <!DOCTYPE> tag, used to specify a Document Type Definition (DTD). This definition precedes any document tags and exists to inform HTML clients of the format of the content that follows—what tags to expect, methods to support, and so forth.

You can think of the DTD as a packing list of sorts that tells the user agent and other clients that read the document what to expect (and not expect) in the document, enabling the client to act more intelligently, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required