Loading

HTML: The Paragraph Tag

The Paragraph Tag

This tutorial teaches the basics of the <p> or paragraph tag.

Let's start with the basic HTML template named index.html. You can download the file from our HTML Video Tutorials Lesson 1 page.

To make a basic paragraph, all you need is a start p tag and an end p tag, like this:


<p></p>

Every HTML start tag, at its simplest, has a less than symbol, the name of the element, and then a greater than symbol. Every HTML end tag has a less than symbol, a forward slash, the name of the element, and then a greater than symbol. These two tags tell the browser to render whatever is inside them as paragraph text.

So, edit the index.html file, and put as much text as you want inbetween the <p></p> tags. Now, save the file with a different name, such as 'paragraph.html.' Then double-click the file and it should open up in a web browser. The text you put inbetween the p tags is now rendered altogether as a paragraph, with default font, font size, font color, and space above and below the paragraph.

Another thing to note: by default, the width of p tags, and many other HTML tags, depends on the width of the browser window:



Finally, let's edit the paragraph.html file and add a lot of extra white space and carriage returns between 2 words inside the p tags:

Now, save the file. Then, refresh your browser by hitting the F5 button on your keyboard. You should not see any extra space in the paragraph because most web browsers ignore extra white space and carriage returns inbetween the p tags.