CSS display
- type
- property
- applies to
- any element
- inherits
- no
- common values
- block, inline, inline-block, flex, grid, none
Where it goes
On a tag whose built-in behavior is not what you need.
Example
span.badge {
display: inline-block;
padding: 2px 8px;
}Common mistakes
- Setting width or height on an inline tag like <span> without changing its display first. Inline tags ignore those properties.
- Using display: none to hide something that a screen reader (software that reads the page aloud) should still find. none removes it from everyone.