I have an image, with text on top. When I rollover the Image I want the opacity of the background image to lower, but not the opacity for the text above it.
I thought that since the text was in a span i could simply tell the span to have the opacity: 1 !important; however that doesn't seem to do the trick. Can anyone help?
Here is the JSFiddle: https://jsfiddle.net/zerojjc/xrwao8n9/
HTML:
<div class="boxThird">
<a class="btnBox boxOne" href="<?php bloginfo('url'); ?>/" title="About Heath, Fania & Co"><span>About</span></a>
</div>
CSS:
.boxThird {
float: left;
width: 33.33%;
height: 400px;
background: #000;
}
.boxThird span {
margin-left: 25px;
position: relative;
top: 344px;
text-decoration: none;
border-bottom: 1px solid #fff;
}
.btnBox {
display: block;
text-align: left;
color: #fff;
text-shadow: 0px 0px 2px #555;
text-transform: uppercase;
text-decoration: none;
font-weight: 400;
font-size: 2em;
letter-spacing: .125em;
}
.boxOne {
height: 100%;
width: 100%;
background-position: center;
background-size: cover;
}
.boxOne {
background-image: url(https://i.imgur.com/izS0fLZ.jpg);
}
.boxOne:hover{
opacity: 0.8;
}
.boxOne:hover span{
opacity: 1 !important;
}