What are block elements and inline elements?


Block Elements

Block Elements always start on a new line and take up the full width available on 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.

Share and support us

Share on social media and help us reach more people