Question:
I want my images to be links, but when I put them inside<a>
tags, it shrinks a bit, which I wouldn’t like to happen.My code:
As you see I currently don’t have any styling for
a
, but I have tried some, display: inline-block;
didn’t work in any context, and setting all: none;
or all: inherit;
on a
also did nothing.Answer:
You need to set.partner a
to have similar properties as .partner
as the a
tag wouldn’t have properties such as display: flex
, then you need to create the same selector as .partner img
but inside that a
tag, so .partner a img
.I think, in general, the better approach is to put every image inside the
a
tag, and just disable the linking for the images that do not link to anywhere for less code duplication.If you have better answer, please add a comment about this, thank you!