I did not notice any zoom, just the "raised" that in fact is the box-shadow that causes this impression, it takes some things:
-
box-shadow
to cause the page's highlight or overlap effect
-
position: relative;
so that the inner element that uses position: absolute; do not leave the area
- I could have used the property
zoom
, but apply a simple width on the element with: hover already does the effect
- The image is in
display: block
to avoid line-height
affect elements, margin: 0 auto;
aligns block elements in the center.
I preferred to use position: absolute;
because only with relative or negative margins could affect the elements around.
In a quick example would be this:
div.item {
position: relative;
width: 200px;
min-height: 400px;
}
div.item div.inner {
border: 1px transparent solid;
width: 100%;
height: 400px;
top: 0;
left: 0;
}
div.item div.inner:hover {
border-color: #a5a5a5;
box-shadow: 8px 7px 0 -3px rgba(55,55,55,0.2);
position: absolute;
z-index: 20;
width: 110%; /*ajusta a largura do zoom*/
}
div.item div.inner img {
display: block;
margin: 0 auto;
width: 100%;
}
<div class="item">
<div class="inner">
<img src="http://i.stack.imgur.com/JW1Bu.jpg"></div></div>
Youcanalsousetransitiontocauseasmootheffect,likethis:
div.item {
position: relative;
width: 200px;
min-height: 400px;
}
div.item div.inner {
border: 1px transparent solid;
width: 100%;
height: 400px;
top: 0;
left: 0;
transition: all .2s;
}
div.item div.inner:hover {
border-color: #a5a5a5;
box-shadow: 8px 7px 0 -3px rgba(55,55,55,0.2);
position: absolute;
z-index: 20;
width: 110%; /*ajusta a largura do zoom*/
}
div.item div.inner img {
display: block;
margin: 0 auto;
width: 100%;
}
<div class="item">
<div class="inner">
<img src="http://i.stack.imgur.com/JW1Bu.jpg">
</div>
</div>