Home > Articles > Web Development > HTML/CSS

  • Print
  • + Share This
This chapter is from the book

Paragraphs

Now that you have a page title and several headings, you can add some ordinary paragraphs to the page.

Paragraphs are created using the <p> tag. The Enigern story should look like this:

<p>Slowly and deliberately, Enigern approached the mighty dragon.
A rustle in the trees of the nearby forest distracted his attention
for a brief moment, a near fatal mistake for the brave knight.</p>
<p>The dragon lunged at him, searing Enigern's armor with a rapid
blast of fiery breath. Enigern fell to the ground as the dragon
hovered over him. He quickly drew his sword and thrust it into the
dragon's chest.</p>

What if you want more (or less) space between your paragraphs than the browser provides by default? The answer is to use CSS. As you'll see, it provides fine control over the spacing of elements on the page, among other things. Figure 4.3 shows what happens when I add another paragraph about Enigern and the dragon to the page. The paragraph breaks are added between the closing and opening <p> tags in the text.

Input

   <p>The dragon fell to the ground, releasing an anguished cry and
seething in pain. The thrust of Enigern's sword proved fatal as
the dragon breathed its last breath. Now Enigern was free to
release Lady Aelfleada from her imprisonment in the dragon's lair. </p>

Output

Figure 4.3

Figure 4.3 An HTML paragraph.

  • + Share This
  • 🔖 Save To Your Account