I checked that it wasn't the width, I set the child element to be 10% wide and only one element
.pct-bar {
height: 4px;
background-color: rgba(121, 121,121,.3);
.gogo {
display: inline-block;
// float: left; // If I set float, this problem will not occur
width: 10%;
height: 100%;
background-color: #fff;
}
}
<div class="pct-bar">
<span class="gogo"></span>
</div>
Gif:
The only way I've found so far is to set float to the child or display:flex to the parent, but hopefully that will answer the question. The text is translated by translator, if you have any questions, please feel free to ask, thank you