Throughout the ages, this question has persisted, with answers that have stood the test of time.
I've explored various solutions, yet none have met my expectations.
I aim to create a fully clickable link for div .content1 without relying on text or JS styling.
Any thoughts or suggestions?
body {
background-image: url("Images/background-bean.jpg");
background-size: contain;
}
h1 {
background-image: url("Images/background-bean.jpg");
}
p {
background-color: white;
background-color: rgba(255, 255, 255, .85);
}
.container {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 100px 400px 400px 50px;
grid-gap: 8px;
background-image: url(Images/content/background_bean.jpg)
}
.nav {
grid-column-start: 1;
grid-column-end: 3;
color: white;
}
.content1,
.content2,
.content3,
.content4 {
background-color: #60330A;
width: 100%;
background-position: center;
text-align: center;
}
.social {
grid-column-start: 1;
grid-column-end: 2;
color: white;
}
.footer {
grid-column-start: 2;
grid-column-end: 3;
color: white;
text-align: right;
}
.content1 {
background-image: url(Images/content/c1standin.jpg)
}
.content1:hover {
transform: scale(1.05);
}
.content2 {
background-image: url(Images/content/c2standin.jpg)
}
.content2:hover {
transform: scale(1.05);
}
.content3 {
background-image: url(Images/content/c3standin.jpg)
}
.content3:hover {
transform: scale(1.05);
}
.content4 {
background-image: url(Images/content/c4standin.jpg)
}
.content4:hover {
transform: scale(1.05);
}
.a .content1:feature {
position: relative;
}
.content1:feature a {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
text-decoration: none;
/* No underlines on the link */
z-index: 10;
/* Places the link above everything else in the div */
background-color: #FFF;
/* Fix to make div clickable in IE */
opacity: 0;
/* Fix to make div clickable in IE */
filter: alpha(opacity=1);
/* Fix to make div clickable in IE */
}
<div class="container">
<div class="nav"><span class="bold">NAV</span> </div>
<div class="content1">
<a title="Our Products" class="content1" id="header-img" href="Images/content/c1standin.jpg"></a>
</div>
<div class="content2">CONTENT</div>
<div class="content3">CONTENT</div>
<div class="content4">CONTENT</div>
<div class="social">SOCIALMEDIA</div>
<div class="footer">
<h6>Image Credit pixabay.com; Elliott Evans 2019</h6>
</div>
</div>