CSS Display
The display property is the most important CSS property for controlling layout.
The display property controls how an element behaves in the page flow. It’s the most important property for layout.
Every HTML element has a default display value — most are either block or inline.
Try It — Block vs Inline vs None
Preview
Display Values Reference
| Value | Behaviour |
|---|---|
block | Starts on new line, takes full width |
inline | Flows within text, only as wide as content |
inline-block | Like inline but respects width/height/padding |
none | Removed from page entirely (no space) |
flex | Flexbox layout (modern, powerful) |
grid | CSS Grid layout |
Tip:
display: nonevsvisibility: hidden—noneremoves the element from the layout (no space).hiddenmakes it invisible but keeps the space.