Skip to content

QuizNot attempted

flex vs inline-flex

What is the difference between display: flex and display: inline-flex?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • Both lay out children with flexbox; flex makes the container block-level (full width), inline-flex makes it inline-level (content width, sits in text)
  • display has an outer type (block vs inline: how the box sits among siblings) and an inner type (flex: how it lays out children)
  • flex is block-level, inline-flex is inline-level, the children behave identically.
  • Not disables wrapping: flex-wrap works the same on both.
  • Not vertical: direction comes from flex-direction, not the outer type.
  • Not no difference: the container's own width and flow differ.
  • Same story for grid vs inline-grid.