Aug
11
2011

Lesson 4 – Paragraphs and Line Breaks

Paragraphs

To separate paragraphs of text, we use the <p> tag.

<html>
<head>
   <title>Hello World Title</title>
</head>
<body>
<p>Hello World </p>
<p>Second line of text.</p>
</body>
</html>

The <p> tag stands for paragraph.  If you load up this html code in your browser, you should see Hello World and Second line of text on double spaced lines.

Line Breaks

What if we wanted to use line breaks instead of paragraphs?  In this case, we would use the <br /> tag or break return tag.

<html>
<head>
   <title>Hello World Title</title>
</head>
<body>
Hello World <br />
Second line of text.
</body>
</html>

Normally, we would use the <p> tag to separate blocks of text.  However, in some situations, the <br /> tag can come in handy but two <br /> tags together shouldn’t be used in place of a <p> tag.

Leave a comment