ARTICLE AD BOX
.box{
background-color: red;
padding: 0.1rem 1rem;
}
img{
width: 24px;
height: 24px;
vertical-align: middle;
}
<div class="box">
<div class="logo">
<img src="https://picsum.photos/200" alt="">
</div>
</div>
with 0.1 rem, its 8 and 4 pixels (the black dots)

with 0.2 rem, its 12 pixels

2,6113 gold badges23 silver badges44 bronze badges
3

.1rem is 1.6px .. if you are getting 8px or 4px, it means you have more CSS to share with us
2026-05-06 11:59:56 +00:00
Commented 20 hours ago
@TemaniAfif the 8px and 4px are just reference to the attached zoomed images, basically there is more space on the top of the image than bottom when using 0.1rem, but not the case with 0.2rem or even 0.11rem
2026-05-06 12:19:55 +00:00
Commented 19 hours ago
@Paulie_D he's already applying vertical-align to remove that space
2026-05-06 12:21:59 +00:00
Commented 19 hours ago