block flex versus inline flex
display: flex;
display: inline-flex;flex is block-level in the parent. inline-flex is a flex container that can sit on a line with surrounding text.
- The two-value forms display: block flex and display: inline flex are equivalent to these short keywords.
<p>
Text
<span class="cluster">
<button type="button">One</button>
<button type="button">Two</button>
</span>
more text.
</p>
<style>
.cluster { display: inline-flex; gap: 8px; align-items: center; }
.cluster button { font: inherit; }
</style>What this markup means
The cluster is a flex container, so the buttons share a main axis and a gap. It is inline-flex, so it stays in the paragraph line rather than breaking onto its own block. This page does not measure that line wrap in a browser.
Related: Flexbox, CSS tutorial: layout