HTML and CSS Reference
In-Depth Information
6
adding Text
Text is obviously an essential part of almost every web page. Though you can have a page or
even a site completely devoid of text, they are the exception rather than the rule. HTML text is
best handled in a structural fashion, with headings introducing paragraphs. In this lesson, you
learn how to quickly add paragraphs, headings, and special characters to your web pages.
workinG wiTH ParaGraPHs
In HTML, paragraphs of text are, aptly enough, contained in a <p> , or paragraph, tag. The
<p> tag separates a text block from other elements, including other <p> tags. A paragraph tag
can contain one or more sentences. For example, quotes from Henry David Thoreau formatted
for the Web would look like this:
<p>Cultivate the habit of early rising. It is unwise to keep the head long on a
level with the feet.</p>
<p>Books are the carriers of civilization. Without topics, history is silent,
literature dumb, science crippled, thought and speculation at a standstill.
I think that there is nothing, not even crime, more opposed to poetry, to
philosophy, ay, to life itself than this incessant business.</p>
By default, browsers typically render paragraph tags with a noticeable margin above and
below the <p> tag content. In Firefox, the example text is depicted with one em of space on top
and bottom as shown in Figure 6-1. Note the separation between the two paragraphs in the
browser where there is none in the code.
An em is a percentage-based measurement equal to the width of the letter “M”
in the current font.
Search WWH ::




Custom Search