HTML Paragraphs

One of the simplest and most useful HTML tags is the paragraph tag. This tag is used in pairs, the opening tag <p> going before the paragraph text and the closing </p> tag going after. You should use the paragraph tag to surround blocks of text within your web page. The browser will then automatically add line breaks before and after your paragraphs to give the page a clean, consistent look.

Try this example:

<title>Using paragraphs</title>


<p>This is the first paragraph</p>

<p>This is the second paragraph</p>

<p>This is a particularly long paragraph which might be
difficult to read in our text editor, but luckily we can
split it over several lines. As long as we surround it with
paragraph tags the web browser will work its magic and
make sure it all fits on our page as intended</p>


When you view this page you should see that the lines of text have been nicely split up into paragraphs as we wanted. Also pay particularly close attention to that last paragraph - when a browser reads HTML code, it essentially ignores the fact that those lines have been split up in our code, and reassembles them into one single paragraph like they are meant to be. We can use spaces, new lines, and indentations in our code to lay it out in a way that is easy to read without having to worry about messing up how the page will display.