DEV Community

Srijan
Srijan

Posted on • Originally published at hackinbits.com

What are block elements and inline elements?

This post first appeared on hackinbits.com

Block Elements

Block Elements always start on a new line and take up the full width available on the web page.

It spans out to the right and to the left as far as possible and blocks out any other element from sitting next to it.

Some of the common block elements include <div>, <p>, <h1> to <h6>, forms etc.

Inline Elements

Inline elements start on the same line and only take the amount of width required to display the content of the element.

It allows other elements to sit next to it.

Some of the common inline elements include <span>, <img>, <a>, <em> etc.

Top comments (0)