The div
and p
elements have their default display
set to block
. Some more block-level elements are the heading elements - h1
to h6
, header
, footer
, section
and form
.
Block elements start on a new line, occupy 100% width by default, and can have height
, width
properties and also have functional margin
on all four sides.
We can make elements like span
, a
and img
behave like block-level elements by setting their display
property to block
:
As can be seen, span
and a
elements
behave like block elements after their display
property is set to block. They start in a new line
and occupy all the available width.