When an element is set to display: inline-flex
and has overflow
set, Firefox is adding about 6px whitespace (similar to the 3px whitespace of normal inline elements).
Firefox
Chrome/Safari/Edge
Wondering if this is a bug with Firefox, or all other browsers?
Codepen: https://codepen.io/cloakedninjas/pen/XQMjvq
.wrapper {
border: 1px red solid;
}
ul {
margin: 0;
display: inline-flex;
list-style-type: none;
overflow-x: auto; /* comment out to remove whitespace */
}
li {
flex: 0 1 100px;
margin-right: 10px;
background: #eee;
}
<div class="wrapper">
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
</div>