Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overlapping divs on :hover

I have divs that grow heightwise on hover and on hover I want them overlap all other divs, and not push them like in my example.

#container{
width: 300px;
}

#container a div{
float:left;
width: 100px;
height: 60px;
-webkit-transition: all 0.25s ease;
}

#container .color1{
background: #444;
}

#container .color2{
background: #555;
}

#container .color3{
background: #666;
}

#container .color4{
background: #777;
}

#container .color5{
background: #888;
}

#container a div:hover{
height: 80px;
-webkit-transition: all 0.25s ease;
}

http://jsfiddle.net/MrSlacker/5wa3X/

like image 651
user2908882 Avatar asked Oct 22 '13 21:10

user2908882


1 Answers

You can make some divs that act like rows for each three divs and set it with position:absolute and z-index.

Check this link http://jsfiddle.net/5wa3X/5/

like image 106
DaniP Avatar answered Nov 09 '22 17:11

DaniP