简体   繁体   English

Internet Explorer-悬停出血时的图像比例

[英]Internet Explorer - image scale on hover bleeds

I have: 我有:

  • A panel 面板
  • It contains an image 它包含一个图像
  • A bottom container inside the image as an overlay 图像内部的底部容器作为叠加层
  • Some content 一些内容

When hovering over the panel, the image scales to 1.1. 将鼠标悬停在面板上时,图像将缩放为1.1。 This works perfectly fine. 这工作得很好。 However, as the image scales, it can be see quickly on the outside and under the overlay.This works seamlessly on Chrome and appears to be an issue in Internet Explorer . 但是,随着图像缩放,可以在外部和叠加层下快速看到它。这在Chrome上可以无缝运行,并且在Internet Explorer中似乎是一个问题。

Question Is it possible to ensure the same behaviour as chrome where the image doesn't expand outside of it's own container and onto the sides / bottom of the overlay? 问题是否可以确保与chrome相同的行为,即图像不会在其自身容器的外部扩展到覆盖层的侧面/底部?

 .item { width: 100%; height: 500px; float: left; background: #ebebeb; overflow: hidden; } .item .content { width: 100%; font-family: "Segoe UI"; padding: 20px; } .item .image { width: 100%; height: 300px; float: left; background: red; overflow: hidden; position: relative; } .item .image img { width: 100%; transition: all 0.3s ease-in-out; -ms-transition: all 0.3s ease-in-out; border: none; outline: none; box-shadow: none; } .item .border { width: 150%; height: 20px; position: absolute; background: #fff; bottom: 0; left: 0; overflow: hidden; } .item:hover .image img { transform: scale(1.1) rotate(0.1deg); -ms-transform: scale(1.1) rotate(0.1deg); -webkit-transform: scale(1.1) rotate(0.1deg); border: none; outline: none; box-shadow: none; } 
 <div class="row"> <div class="large-up-2"> <div class="column"> <div class="item"> <div class="image"> <img src="http://www.planwallpaper.com/static/images/Beautiful_Wallpaper_1080p_Full_HD.jpg"/> <div class="border"></div> </div> <div class="content"> Content </div> </div> </div> </div> </div> 

通过在下面的元素上添加-1px的边距来解决底部问题,​​从而弥补了1px的空白。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM