What Is A HTML Paragraph?

What Is A HTML Paragraph

Date First Published: 29th October 2022

Topic: Web Design & Development

Subtopic: Web Development

Article Type: Computer Terms & Definitions

Difficulty: Medium

Difficulty Level: 4/10

CONTENTS

Learn more about what a html paragraph is in this article.

A HTML paragraph defines a block of text in a HTML document, supported by all web browsers, that always starts on a new line and web browsers automatically add a margin (whitespace) before and after a paragraph to separate them and help users to differentiate between different paragraphs. The margin size can be adjusted with CSS. Within the <p> tag, the text can be specified. An example of a HTML paragraph can be seen below:

<p>This is a paragraph with some text.</p>

The output:

This is a paragraph with some text.

Note: Info Icon

Use the <p> tag for paragraph purposes. Do not use them to create line breaks or extra spaces between different HTML elements. Instead, use the <br> tag, which is specifically designed for line breaks and does not require a closing tag.

Spacing

Spaces within the <p> tag do not change the display or create line breaks. If there are spaces in the tag, the browser will automatically remove them when displaying the page. As shown below, the output of the HTML paragraph does not change by adding spaces or starting a new line:

<p> This paragraph contains a lot of spaces within the tag, but the browser ignores them. </p>

This paragraph contains a lot of spaces within the tag, but the browser ignores them.


Feedback

  • Is there anything that you disagree with on this page?
  • Are there any spelling, grammatical, or punctuation errors on this page?
  • Are there any broken links or design errors on this page?

If so, it is important that you tell me as soon as possible on this page.