Skip to content

Instantly share code, notes, and snippets.

@gustaff-weldon
Created September 26, 2014 09:39
Show Gist options
  • Save gustaff-weldon/67653abd11673b19ca15 to your computer and use it in GitHub Desktop.
Save gustaff-weldon/67653abd11673b19ca15 to your computer and use it in GitHub Desktop.
Background and opacity transitions
/**
* Background and opacity transitions
*/
.container {
background: rgba( 255, 150, 10, 100);
overflow: hidden;
}
.box {
float: left;
margin: 10px;
background: rgba(100,150,30,0.5);
width: 200px;
height:200px;
transition: all 0.3s ease-in;
}
.container:hover .bg-hide,
.bg-hide:hover {
background: rgba(0,0,0,0);
}
.container:hover .hide,
.hide:hover {
opacity: 0;
}
<div class="box hide">This box dissappears completely </div>
<div class="box bg-hide">This box's background fades out</div>
<div class="container">
<div class="box hide">This box dissappears completely </div>
<div class="box bg-hide">This box's background fades out</div>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment