HTML Paragraphs Overview

We already had an introduction about HTML Paragraphs. This lesson will just give us an overview of paragraphs and we’ll get a little bit more into details about how paragraphs work.

A paragraph element is defined as follows;

HTML Paragraph Exercises;

Imagine the following scenario

The content will not be displayed in the same order as we have it outlined above in code. To be able to display it like that, we’d need to use line break element or <br>. Also please note that even if you place a lot of spaces between the words the web browser will still remove these extra spaces automatically.

HTML Paragraph

HTML Elements – Nested elements

Another thing to keep in mind is nesting of elements like in the example.

If you notice here we have a main element paragraph <p> then we have embedded the image <img> element then the line break <br> element. This is a powerful feature and later on we’ll be taking advantage of it.

Nested HTML Elements

Pre-defined content <pre>

Imagine that we have a paragraph as follows.

Take a look at the many spaces that we have kept between the words of the content. If we run it as a paragraph then the web browser will eliminate the extra spaces and will keep only one space between the words.

If we want to keep the extra spacing in the subject format then we’d need to use another HTML element or the <pre> element.

Pre-defined content <pre>

Take a look at this point. We have kept the extra spacing and format of the text by using the <pre> element. You can run the HTML Paragraphs.html file for that purpose

Ad: Wordpress blog setup services. Get your Wordpress blog setup in under $100 and in less then 3 days! Click here

Mobile App Creation

Mobile App Creation Service

Ad: Get a mobile app based on your website. Get more visitors. Get into your customer pockets! Click here