please read the full post before marking this as a duplicate
We're all familiar with the annoying default agent stylesheet from browsers. We're probably also familiar with the annoying anchor and image tags with whitespace underneath it.
So here's my issue:
HTML:
<div>
<a href="#">
<img src="src">
</a>
<a href="#">
<img src="src">
</a>
<a href="#">
<img src="src">
</a>
</div>
I used some social icons for test purposes and it looks like this:
I want the anchor to be a square, so in my CSS I simply say a { display: inline-block; }
But now there's a whitespace underneath the image, so in my CSS I say img { display: block }
Everything with the anchor tag and image tag seems to be fine now, but...
Now there's a whitespace inside the div, without there's any evidence it's either the anchor tag or the image tag.
You might think: "well that's easy. Just say div { font-size: 0 }
in your CSS". Well that causes another issue: the div does not measure the height very well. It slices off one pixel on the top:
So if there are any fixes: how would I fix this without ugly fixes like: padding-top: 1px
or margin-bottom: ...px
If there are no fixes: that would be weird