HTML Tutorial/Paragraphs

From Wikiversity
Jump to navigation Jump to search

The Element <p>[edit | edit source]

To create a paragraph, simply type in the <p>1 element with its opening and closing tags:

<html>
   <head>
      <title>first page</title>
   </head>
   <body>
      <p>This is a paragraph. </p>
      <p>This is another paragraph. </p>
   </body>
</html>

Browsers automatically add an empty line before and after a paragraph.

Single Line Break

Use the <br />2 tag to add a single line of text without starting a new paragraph:

<html>
   <head>
      <title>first page</title>
   </head>
   <body>
      <p>This is a paragraph. </p>
      <p>This is another paragraph. </p>
      <p>This is <br /> a line break </p>
   </body>
</html>

The <br /> element is an empty HTML element. It has no end tag.

1. <p>
Defines a paragraph.
2. <br />
Defines a single line break.