I'm working on a container div
that contains multiple smaller div
elements, all with the style rule float:left;
. When I hover over one of the smaller div
elements, I want it to increase in height and width while overlaying the other div
elements without affecting their positions.
Here is the HTML structure:
<div id="boxcontainer">
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
</div>
This is the corresponding CSS:
.box {
float: left;
position: relative;
width: 150px;
height: 150px;
margin: 5px;
background-color: yellow;
}
#boxcontainer {
position: relative;
width: 500px;
height: auto;
}
.box:hover {
z-index: 100;
width: 300px;
height: auto;
}
Any ideas on how to achieve this effect?