I know there seems to be a lot of questions like this but they all seem to do something slightly different than what I have. Most just ADD text. I have some CSS that does that already, what I'm trying to do is modify what I got to have text ALREADY there that gets replaced. I just can't seem to wrap my brain around this/can't make the right connections to make it work without breaking something else.
Right now, if you hover over the picture, the whole picture gets partially whited-out and text appears. This works exactly how I need it. What I can't figure out is how to ADD text that is there BEFORE and disappears AFTER.
I saw this fiddle: http://jsfiddle.net/d64A9/ but I can't grasp how to apply that (if it's even the right thing to do).
Here is what I got:
CSS
.pic2 {
height: 125px;
background: url(http://somewebsite/somepic.jpg) no-repeat;
background-size: 100%;
overflow:hidden;
}
.text2 {
height: 125px;
background: #FFF;
opacity: 0;
}
h1 {
font-weight: bold;
color: #000;
font-size: 42px;
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
text-align: center;
}
.pic2:hover .text2 {
opacity: 0.6;
text-align: center;
color: #000000;
font-size: 20px;
font-weight: 700;
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
padding: 30px;
}
HTML
<a href="http://somewebsite/page" style="text-decoration: none;">
<div class="pic2">
<div class="text2">
<h1>Private</h1>
<br />
Personal information and requirements are kept completely confidential.
</div>
</div>
</a>