Skip to content

Instantly share code, notes, and snippets.

@schadeck
Created March 27, 2012 15:33
Show Gist options
  • Select an option

  • Save schadeck/2217057 to your computer and use it in GitHub Desktop.

Select an option

Save schadeck/2217057 to your computer and use it in GitHub Desktop.
CSS# Card Deck Expand
/**
* CSS# Card Deck Expand
*/
*{padding:0px;margin:0px;}
.cards{
position: relative;
height: 200px;
width: 200px;
float: left;
margin: 20px;
}
.cards:hover{
z-index: 1000;
}
.card{
display: block;
position: absolute;
top:0px;
left: 0px;
width: 200px;
height: 200px;
background: #fff;
transition: all 0.3s ease-in-out;
overflow: hidden;
padding: 10px;
box-shadow:#555 0px 1px 5px;
}
.card:nth-child(2){
height: 194px;
width: 194px;
top: 3px;
left: 8px;
}
.card:nth-child(1){
height: 188px;
width: 188px;
top: 6px;
left: 16px;
}
.cards:hover .card{
width: 200px;
height: 200px;
}
.cards:hover .card:nth-child(1){
left: 60px;
transform:rotate(5deg);
}
.cards:hover .card:nth-child(2){
}
.cards:hover .card:nth-child(3){
left: -60px;
transform:rotate(-5deg);
}
<!-- content to be placed inside <body>…</body> -->
<div class="cards">
<a href="#"><img class="card" alt=":)" src="http://placehold.it/200/933/fff&text=+" /></a>
<a href="#"><img class="card" alt=":)" src="http://placehold.it/200/393/fff&text=+" /></a>
<a href="#">><img class="card" alt=":)" src="http://placehold.it/200/339/fff&text=+" /></a>
</div>
<div class="cards">
<a href="#">><img class="card" alt=":)" src="http://placehold.it/200/333/fff&text=+" /></a><a href="#">"><img class="card" alt=":)" src="http://placehold.it/200/666/fff&text=+" /></a>a href="#">#"><img class="card" alt=":)" src="http://placehold.it/200/999/fff&text=+" /></a>
</div>
<div class="cards<a href="#">#"><img class="card" alt=":)" src="http://placehold.it/00c/00c/fff&text=+" <a</a>href="#">"#"><img class="card" alt=":)" src="http://placehold.itc000/c00/fff&text=+"<a h</a>ef="#">="#"><img class="card" alt=":)" src="http://placehold.i0c000/0c0/fff&text=+" />
</a>/div>
{"view":"split-vertical","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment