HTML and CSS Reference
In-Depth Information
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.
Xes: 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 topic.
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 com-
mon 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
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. The X in XHTML stands for eXtensible
and is derived from another computer language called Extensible Markup Language, or XML.
XHTML, like its XML cousin, is much more rigid than HTML. For starters, XHTML is case-
sensitive: All tags and attributes must be in lowercase. In addition, all tags must be explicitly
closed whether via a tag pair, like <p>…</p> , or a closing slash mark within the tag itself, like
the line break tag, <br/> . The trade-off for this increased fastidiousness is a more widespread
readability among various browsers.
Search WWH ::

Custom Search