DEV Community

Cover image for HTML tags | p
Carlos Espada
Carlos Espada

Posted on • Updated on

HTML tags | p

It is used to represent a paragraph. It is normally represented visually as text blocks separated from adjacent blocks by blank lines, but <p> can also serve to structurally group related content, such as images or form fields.

They are block elements, and they are closed automatically if another block element is opened before adding the closing tag </p>. However, the safest thing is to always close them and thus avoid possible unwanted behavior if the HTML behind it is modified later.

Using paragraphs in the content makes the page more accessible since assistive technologies allow you to jump from one to another, just as you do by reading visually.

However, using empty <p> to add extra space can be problematic for those same users as screen readers will announce the paragraph but without content, which can be confusing and frustrating. To achieve this effect of extra space, you have to use the CSS margin property.

  • Type: block
  • Self-closing: No
  • Semantic value: No

Definition and example | Support

Top comments (0)