CSS转换:缩放重叠容器div的填充
我有一个网格的图像与填充的权利和顶部。我添加了动画,以便在鼠标悬停图像时稍微缩放图像。问题是,当图像缩放时,它与上面提到的填充重叠。我通过使用边距而不是填充来解决这个问题,但是这个html来自我的wordpress主题,使用边距而不是填充会导致其他我无法处理的问题 有没有办法通过填充实现这种行为 谢谢! 例子: HTML:CSS转换:缩放重叠容器div的填充,css,webkit,scale,overlapping,Css,Webkit,Scale,Overlapping,我有一个网格的图像与填充的权利和顶部。我添加了动画,以便在鼠标悬停图像时稍微缩放图像。问题是,当图像缩放时,它与上面提到的填充重叠。我通过使用边距而不是填充来解决这个问题,但是这个html来自我的wordpress主题,使用边距而不是填充会导致其他我无法处理的问题 有没有办法通过填充实现这种行为 谢谢! 例子: HTML: 因此,当图像缩放时,您希望其他图像被推到右侧?什么是“其他问题”有边距?从“.grid gallery item”中删除填充物,并将边框底部和边框右侧设置为“5px纯白”如
因此,当图像缩放时,您希望其他图像被推到右侧?什么是“其他问题”有边距?从“.grid gallery item”中删除填充物,并将边框底部和边框右侧设置为“5px纯白”如何?@cocoa我希望它能剪辑内容border@makshh每个网格库项目的宽度为25%,因此4个图像可以放在一行中,当使用边距时,我必须使用javascript计算图像的大小,因为边距不包含在宽度属性中。因此,当图像缩放时,您希望其他图像被推到右侧?什么是“其他问题”有边距?从“.grid gallery item”中删除填充物,并将边框底部和边框右侧设置为“5px纯白”如何?@cocoa我希望它能剪辑内容border@makshh每个网格库项目的宽度为25%,因此4个图像可以放在一行中,当使用边距时,我必须使用javascript计算图像的大小,因为边距不包含在宽度属性中。
<div class="fs_grid_gallery">
<div class="grid-gallery-item">
<img src="http://propixelpanama.com/wp-content/uploads/2015/09/azrieli-1-540x375.jpg" alt="" class="fw_featured_image">
</div>
<div class="grid-gallery-item">
<img src="http://propixelpanama.com/wp-content/uploads/2015/09/azrieli-1-540x375.jpg" alt="" class="fw_featured_image">
</div>
<div class="grid-gallery-item">
<img src="http://propixelpanama.com/wp-content/uploads/2015/09/azrieli-1-540x375.jpg" alt="" class="fw_featured_image">
</div>
<div class="grid-gallery-item">
<img src="http://propixelpanama.com/wp-content/uploads/2015/09/azrieli-1-540x375.jpg" alt="" class="fw_featured_image">
</div>
</div>
.grid-gallery-item
{
width: 25%;
padding-right:5px;
padding-top:5px;
position: relative;
float: left;
}
img
{
display: block;
width: 100%;
height: auto;
}
.fs_grid_gallery
{
padding-bottom:5px;
padding-left:5px;
width: 100%;
}
div.grid-gallery-item, div.grid-gallery-item a, .gallery_item_wrapper
{
position:relative;
overflow: hidden;
}
img.fw_featured_image
{
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
overflow: hidden;
box-sizing: border-box;
max-width: 100%;
}
div.grid-gallery-item:hover .fw_featured_image
{
-webkit-transform: scale(1.05);
-moz-transform: scale(1.05);
-o-transform: scale(1.05);
-ms-transform: scale(1.05);
transform: scale(1.05);
}