OK, I know at first might be a bit confusing, but display
is talking about the parent element, so means when we say: display: flex;
, it's about the element and when we say display:inline-flex;
, is also making the element itself inline
...
It's like make a div
inline or block, run the snippet below and you can see how display flex
breaks down to next line:
.inline-flex {_x000D_
display: inline-flex;_x000D_
}_x000D_
_x000D_
.flex {_x000D_
display: flex;_x000D_
}_x000D_
_x000D_
p {_x000D_
color: red;_x000D_
}
_x000D_
<body>_x000D_
<p>Display Inline Flex</p>_x000D_
<div class="inline-flex">_x000D_
<header>header</header>_x000D_
<nav>nav</nav>_x000D_
<aside>aside</aside>_x000D_
<main>main</main>_x000D_
<footer>footer</footer>_x000D_
</div>_x000D_
_x000D_
<div class="inline-flex">_x000D_
<header>header</header>_x000D_
<nav>nav</nav>_x000D_
<aside>aside</aside>_x000D_
<main>main</main>_x000D_
<footer>footer</footer>_x000D_
</div>_x000D_
_x000D_
<p>Display Flex</p>_x000D_
<div class="flex">_x000D_
<header>header</header>_x000D_
<nav>nav</nav>_x000D_
<aside>aside</aside>_x000D_
<main>main</main>_x000D_
<footer>footer</footer>_x000D_
</div>_x000D_
_x000D_
<div class="flex">_x000D_
<header>header</header>_x000D_
<nav>nav</nav>_x000D_
<aside>aside</aside>_x000D_
<main>main</main>_x000D_
<footer>footer</footer>_x000D_
</div>_x000D_
</body>
_x000D_
Also quickly create the image below to show the difference at a glance: