Skip to content
techsnow

Layout

Display Property

display decides how an element behaves in the layout.

ValueBehaviour
blockStarts on a new line, full width.
inlineSits in a line of text; ignores width and height.
inline-blockSits in a line but accepts width, height and vertical padding.
flexTurns the element into a flexbox container.
gridTurns the element into a grid container.
noneRemoves the element completely.
a.button { display: inline-block; padding: 10px 20px; }
.menu { display: flex; }
.modal { display: none; }
.modal.open { display: block; }

display: none vs visibility: hidden

display: none removes the element and its space. visibility: hidden hides it but keeps an empty gap where it was.