I been trying all day to find a nice simple short pure-css/html code only to make a div disappear when a button is clicked. I would prefer CSS but if not possible will take a JS solution instead.
Lot of solutions on overflow but most use js. please take a look at my code below and add a example or suggestion below. Thanks for any help, Stewy
body {
background-color: #6B6B6B;
font-family: Arial;
color: grey;
font-size: 12px;
margin: 0px;
}
/*............... bgcover ...............*/
.bgcover {
position: fixed;
top: 50px;
left: 50px;
width: 200px;
height: 200px;
background-color: rgba(0, 0, 0, .4);
}
.call {
position: fixed;
top: 100px;
left: 100px;
}
/*........ crossfade on buttons ........*/
.hover,.nohover{
transition:.3s;
position:absolute;
}
.nohover{
opacity:0;
}
a:hover .hover{
opacity:0;
}
a:hover .nohover{
opacity:1;
}
<div class="bgcover" align="center">
<p>Button turns off this bg cover div.</p>
</div>
<div class="call">
<a href="bgcoveroff.htm">
<img src="http://wizzfree.com/pix/call2.png" width="100" class="nohover">
<img src="http://wizzfree.com/pix/call.png" width="100" class="hover"></a>
</div>