Setting height on inline elements doesn't work.
Setting height on inline-flex elements work even though it shouldn't!
why does setting height on an inline-element work in the below example?
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
div {
border: 1px solid red;
padding: 10px;
margin-top: 20px;
}
span {
border: 1px solid black;
}
.container{
border: 5px solid yellow;
display: inline-flex;
height: 60px;
}
<body>
<div>
<span class="container">
<span>1</span><span>2</span><span>3</span><span>4</span><span>5</span>
</span>
</div>
</body>
EDIT:
The linked question does not explain why inline-flex
accepts a height.
inline
elements do not accept a height!
setting an element to inline-flex
set's the element outer display mode to inline
,