Chapter 1. Structuring Documents for the Web

In this chapter, you learn the key concept of creating any web page: how to give it structure. You need to add structure to a document so that web browsers can present the page to people who visit your site in a way they will understand. For example, imagine a news article that contains a headline (or title) and several paragraphs of text; if you wanted to put this article on the Web, you would need to add structure to the words in the document so that the browser knows which words are the headline, and where each paragraph starts and ends. To give a document structure, you'll need to learn how to create web pages using HTML. Or, to be a little more precise, this book focuses on a type of HTML known as XHTML.

In this chapter you will:

  • Create several example web pages in XHTML.

  • See how a web page describes its structure to a web browser.

  • Discover the meaning of some key terms used by web designers, such as elements, attributes, tags, and markup.

By the end of the chapter, you will have learned the basic building blocks needed to build a web page, and will have put this into practice with several examples.

A Web of Structured Documents

Before we create our first web page, let's just take a moment to look at the printed information we see every day, and how it compares to what we see on the Web. Every day, you come across all kinds of printed documents — newspapers, train timetables, insurance forms. You can think of the Web as being a sea of documents ...

Get Beginning HTML, XHTML, CSS, and JavaScript® now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.