I have an image gallery with all images being the same size. I'm trying to add a colored rounded border around the images, however I am having some issue doing so.
For one, the border takes up the entire width of the box, when I only want it to be a bit bigger than the image it's around. Not only that, but it doesn't even cover the entire image, only forming an eclipse around some of it. I used a random image for this, but the same thing happens to all the other images.
.galleryStyle {
color: white;
width: 100%;
background: black;
}
.galleryContainer {
height: 100%;
margin: 10px;
padding: 15px;
border-radius: 100%;
background: red;
}
.galleryGrid {
display: grid;
grid-template-columns: repeat(2, 3fr);
padding: 5px;
margin: 10px;
height: 100%;
width: 60%;
}
<body class="galleryStyle">
<div class="galleryGrid">
<div class="galleryContainer">
<div>
<a href="google.com">
<img src="https://i.ytimg.com/vi/BY3PXd2zLT4/maxresdefault.jpg" alt="image1">
</a>
</div>
</div>
</div>