HTML and CSS Reference
In-Depth Information
where heading elements are elements marked with the <h1> through <h6> heading
tags. The hgroup element was introduced in HTML5 and is not part of older HTML or
XHTML specifi cations.
Group the fi rst two headings in Dave's document to indicate that they should be inter-
preted as a main title and a subtitle.
The hgroup element can
contain only h1 through
h6 elements or other
hgroup elements.
To group the first two headings in the document:
1. Return to the jprop.htm file in your text editor.
2. Indent the first two headings in the document and then enclose them within
<hgroup> tags as shown in Figure 1-17.
Figure 1-17
Grouping the h1 and h2 headings
h1 and h2 head ings
are grouped together
3. Save your changes to the file.
Marking Paragraph Elements
As you saw earlier, you can mark a paragraph element using the <p> tag, which has
the syntax
<p> content </p>
where content is the content of the paragraph. In older HTML code, you might occa-
sionally see paragraphs marked with only the opening <p> tags, omitting closing tags. In
those situations, a <p> tag marks the start of each new paragraph. While this convention
is still accepted by many browsers, it violates HTML's syntax rules. In addition, if you
want XHTML-compliant code, you must always include closing tags.
Many articles on the J-Prop Shop page are enclosed within paragraphs. You'll add
these paragraphs now.
To add four paragraphs to Dave's Web page:
1. Return to the jprop.htm file in your text editor.
2. Directly below the h2 heading Welcome , insert the following paragraph code,
indented as shown in Figure 1-18:
<p>If you're looking for high-quality, hand-crafted
juggling and circus products, the J-Prop Shop is
the store for you. I've designed and built props
for the past 35 years, and my products have been
used by professional entertainers and hobbyists
throughout the world. Our prices are reasonable and
our quality is excellent.
Search WWH ::

Custom Search