I'm in need of assistance. I have a grid containing several images that I want to make clickable by adding anchor tags, but when I do this, the images seem to disappear completely. I suspect there's an issue with them being inside the container div (refer to the code below), yet I can't pinpoint what's wrong. Additionally, I require the text beneath the image to be clickable as well, hence why I included it within the anchor tag. However, I'm having trouble removing the underline from the text even after applying 'text-decoration: none;'. Any suggestions on how to resolve all these issues? Please refer to the screenshot below for the current appearance.
HTML Code:
<section class="country">
<h1>Our country</h1>
<div class="container2">
<a href="sub_history.html">
<div class="history">
<p>History</p>
</div>
</a>
<div class="culture">
<p>Culture</p>
</div>
<div class="demo">
<p>Demographics</p>
</div>
<div class="geo">
<p>Geographics</p>
</div>
</div>
</section>
And CSS:
.country {
height: 85vh;
width: 100%;
background-color: #fff;
}
.country h1 {
padding-top: 45px;
text-align: center;
}
.container2 {
display: grid;
grid-gap: 0px;
grid-template-columns: repeat(auto-fit, minmax(25%, 1fr));
grid-template-rows: repeat(2, 450px);
margin-top: 5%;
}
.container2>div>img {
width: 100%;
height: 100%;
object-fit: cover;
}
.history {
background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 100%), url("images/4ond/hist.jpg");
background-size: cover;
background-position: center center;
}
.culture {
background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 100%), url("images/4ond/culture.jpg");
background-size: cover;
background-position: center center;
}
.demo {
background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 100%), url("images/4ond/demo.jpg");
background-size: cover;
background-position: center center;
}
.geo {
background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 100%), url("images/4ond/geo.jpg");
background-size: cover;
background-position: center center;
}
.history p,
.culture p,
.demo p,
.geo p {
margin-top: 95%;
text-align: center;
color: #fff;
font-size: 25px;
}
https://i.sstatic.net/n8Gnv.png
If anyone has any ideas or solutions, your help would be greatly appreciated.