Understanding HTML Paragraphs

HTML paragraphs are used to break up blocks of text into sections. Each paragraph is its own chunk of content, and you typically use paragraphs to separate different topics or ideas on a webpage.

In HTML, paragraphs are created using the <p> tag, which wraps the content. The opening tag <p> starts the paragraph, and the closing tag </p> ends it.

Try out the examples below using our free live HTML editor to test the code yourself!

HTML Paragraph Examples with Explanations

1. Basic Paragraph:


<p>This is a simple paragraph.</p>
  

In this example, we have a basic paragraph with just one sentence. The <p> tag marks the start, and the </p> tag marks the end. Everything in between is the paragraph content.

2. Paragraph with Multiple Sentences:


<p>This is a paragraph with multiple sentences. Each sentence is separated by a period.</p>
  

This example shows how paragraphs can contain multiple sentences. The sentences are just separated by a period (.) as you would normally write text.

3. Paragraph with Line Breaks:


<p>This paragraph<br>has a line break<br>right here.</p>
  

Here, instead of starting a new paragraph, we use the <br> tag to add a line break. This forces the text to move to the next line inside the same paragraph.

4. Paragraph with Text Formatting:


<p>This is a <strong>bold</strong> paragraph with <em>italicized</em> text.</p>
  

This example uses formatting tags inside a paragraph. The <strong> tag makes text bold, while the <em> tag makes text italic. These tags can be placed inside the paragraph tags.

HTML paragraphs are a simple way to break up and organize content on a webpage. They are one of the most important tools for structuring text.

Note: We aim to make learning easier by sharing top-quality tutorials, but please remember that tutorials may not be 100% accurate, as occasional mistakes can happen. Once you've mastered the language, we highly recommend consulting the official documentation to stay updated with the latest changes. If you spot any errors, please feel free to report them to help us improve.

top-home