2014-10-17 109 views
-1

在以内联方式显示并由图像形成的列表中,如何使图像不是鼠标移动而是移动?当我将鼠标放在图像上时,两侧的图像也会移动。我怎么能让他们不动? (我设置了图像的CSS设置,如何使图像不会移动而不是鼠标移动

img { 
    width:42px; 
    height:60px; 
    } 
img:hover { 
    width:62px; 
    height:80px; 

所以,当鼠标放完了它只是调整大小。)

+0

所以,你想要的形象扩大和重叠其他图像onHover选项? – Grice 2014-10-17 13:11:22

+0

不,图像onhover必须越过 – DKim 2014-10-17 13:13:21

+0

旁边的图像这就是重叠意味着什么。看看[CSS定位](http://www.w3schools.com/css/css_positioning.asp),特别是z-index。 – Grice 2014-10-17 13:15:21

回答

1

也许这就是你想要的?

img:hover { 
    -webkit-transform: scale(1.30); 
    -moz-transform: scale(1.30); 
    -o-transform: scale(1.30); 
    transform: scale(1.30); 

    -webkit-transition: all 0.5s; 
    -moz-transition: all 0.5s; 
    -o-transition: all 0.5s; 
    transition: all 0.5s; 
    z-index: 2; 
} 

Demo