DEV Community

Cover image for Block-Level Elements VS Inline Elements
Sudhanshu Gaikwad
Sudhanshu Gaikwad

Posted on

Block-Level Elements VS Inline Elements

Block-Level Elements
A block-level element always starts on a new line.

  • A generic container for block-level content.
  • Headings.

  • A paragraph.

    • An unordered list.
    1. An ordered list.
  • A list item (inside
      or
        ).
  • A section of a document.
  • An independent self-contained content.
  • Example:
    index.html

<div>
  <h1>This is a Heading</h1>
  <p>This is a paragraph inside a div.</p>
</div>

Top comments (0)