CSS Display Properties Cheatsheet

Display Type Example Width/Height Padding/Margin Border Box Shadow Text Shadow Full Width Wraps Inline Vertical Align Common Uses Default HTML Tags
inline
1 2 3 4
  • Text styling
  • Emphasis
  • Links
  • Highlights
span a strong em b i u sup sub abbr cite q code mark s small time label input textarea select option button output img br wbr object iframe picture source
block
1 2 3 4

N/A
  • Layout containers
  • Sections
  • Cards
  • Articles
  • Modals
div section article aside header footer main nav figure figcaption address p h1 h2 h3 h4 h5 h6 pre blockquote hr ul ol li table tr form fieldset legend details dialog caption thead tbody tfoot th td canvas dialog summary
inline-block
1 2 3 4
  • Buttons
  • Badges
  • Images
  • Icons
  • Chips
button input select textarea img canvas progress meter label option
flex
1 2 3 4
  • Navigation bars
  • Carousels
  • Responsive grids
  • Toolbars
inline-flex
1 2 3 4
  • Inline menus
  • Button groups
  • Tags
  • Chips
grid
1 2 3 4
  • Photo galleries
  • Dashboards
  • Complex layouts
inline-grid
1 2 3 4
  • Embedded widgets
  • Inline grids
none
  • Scripts
  • Styles
  • Metadata
  • Template elements
script style meta link base template