Block-level content - Glossary | MDN

Examples

In this example, two paragraph (<p>) elements are put in a <div>.

html

<div>
  <p>
    This the first paragraph. The background color of these paragraphs have been
    colored to distinguish them from their parent element.
  </p>
  <p>This is the second paragraph.</p>
</div>

The paragraph(<p>) elements are block-level by default. That is why they are displayed in block layout:

p {
  background-color: #8abb55;
}

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.