The display
property defines how an element is displayed. Common values include block
, inline
, inline-block
, and none
.
Example:
<div class="block-example">Block Element</div>
<span class="inline-example">Inline Element</span>
CSS Example:
.block-example {
display: block;
}
.inline-example {
display: inline;
}
A block
element takes up the full width available, with a new line before and after. An inline
element only takes up as much width as necessary.