O'Reilly logo

HTML5 24-Hour Trainer by Mark Fletcher, Joseph W. Lowery

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 2. Creating Your First Web Page

The beauty of the HTML language is that you don't need to be a rocket scientist — or even a computer science major — to write it. Moreover, you don't need a special program to create an HTML page. Any text editor will do: the simpler, the better.

In this lesson, you gain an understanding of the basic structure common to all HTML pages. The core document you create can serve as a foundation for the most complex web page you can envision — or, as you'll see in this chapter's exercise — the most basic.

HTML5 SYNTAXES: AN EMBARRASSMENT OF RICHES

Before we proceed with the actual page code, we need to take a moment to explain the type of code that will be used in this chapter and throughout the book.

During the development of previous HTML versions, two different syntaxes were used: standard HTML and the more structured XHTML. When first created, HTML was a fairly loose language in terms of the requirements it placed on authors. For example, certain common tags, such as the paragraph tag <p>, did not require a corresponding closing element. Likewise, attribute values did not have to be enclosed in quotes; class="item" was the same as class=item. The primary benefit to standard HTML syntax was that browsers were very forgiving of coding errors which, in turn, lowered the entry barrier for beginning web page authors.

As the Web expanded in its usefulness, the drive to use the information it contained in many more situations gave rise to the XHTML syntax. ...

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