Reputation: 61
Can anyone explain the cause of this difference shown below?
in the bottom panel, the colored bars render thicker than the top panel.
The CSS is the same for both;
.colored-bar {
width: 100%;
height: 2px;
}
Browser: Chrome 84
Please see live repro here: CodePen
What i see in CodePen;
Upvotes: 0
Views: 279
Reputation: 1616
Probably you have turned on magnification in the browser. Disable it and everything should be correct.
125% magnification show exactly the same problem as on your screenshot.
Also if I set scaling directly in the Windows screen settings to 125% the problem shows up.
I may found a possible solution. Just use pseudoelements instead of normal ones and everything seems to be working perfectly, but I didn't do an extensive testing.
.kpi {
border: 1px solid black;
height: 56px;
width: 175px;
padding: 10px;
}
.box {
display: flex;
flex-direction: column;
width: 45px;
height: 50px;
text-align: center;
}
.box::after {
content: '';
width: 100%;
border-bottom: 2px solid #0f0;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="d-flex space-between">
<div class="col d-flex flex-column justify-content-between">
<div class="row kpi mb10 d-flex justify-content-between">
<div class="box">
Test
</div>
<div class="box">
Test
</div>
<div class="box">
Test
</div>
</div>
<div class="row kpi mb10 d-flex justify-content-between">
<div class="box">
Test
</div>
<div class="box">
Test
</div>
<div class="box">
Test
</div>
</div>
</div>
</div>
Upvotes: 2