I have several same flex items, containing a rectangle span with margin-right, and a text span scaled due to the font-size limitation of browsers like Chrome. I put them into a flex container but I figured that some of them are incorrect in Chrome, without margin-right of the rect span, but Firefox is fine.
#flex-container {
display: flex;
width: 50px;
}
.flex-item {
display: flex;
flex-direction: row;
align-items: center;
align-content: space-around;
margin-right: 2.1875px;
position: relative;
height: 7px;
}
.rect {
width: 5px;
height: 5px;
display: inline-block;
background: rgb(6, 74, 105);
margin-right: 0.875px;
}
.text {
position: relative;
font-size: 12px;
display: inline-block;
vertical-align: middle;
transform: scale(0.5);
transform-origin: left center;
width: 20.5px;
}
<div id="flex-container">
<div class="flex-item">
<span class="rect"></span>
<span class="text">Mazda</span>
</div>
<div class="flex-item">
<span class="rect"></span>
<span class="text">Mazda</span>
</div>
<div class="flex-item">
<span class="rect"></span>
<span class="text">Mazda</span>
</div>
<div class="flex-item">
<span class="rect"></span>
<span class="text">Mazda</span>
</div>
<div class="flex-item">
<span class="rect"></span>
<span class="text">Mazda</span>
</div>
</div>
The code snippet run result is correct, too. But not in https://jsfiddle.net/xgahLv3k/1/
Here is the demo image image, the second item's rectangle has no margin-right.
How can I fix this? Thank you!