悬停图像<div>在chrome中向上移动

时间:2016-01-31 19:11:45

标签: html google-chrome firefox hover

当我在Chrome中查看我的网页时,我的div正在向上推。我无法理解为什么它在Firefox中很好,但是一旦我在Chrome,IE或MS Edge中加载页面,它就会上升大约15px。

如果这是共享HTML / CSS代码的不正确方式,我很抱歉,但现在是:

.tw {
background-image: url(https://i.imgur.com/tyrNFnz.png); 
repeat scroll 0 0 transparent;
background-position: bottom left;
display: block;
width: 131px;
height: 159px;
left: 50%;
margin-top: -1879px;
margin-left: -192px;
z-index: 4;
opacity: 0;
position: absolute;
-webkit-transition: .4s all ease-in-out;
-moz-transition: .4s all ease-in-out;
-o-transition: .4s all ease-in-out;
transition: .4s all ease-in-out;
}

.tw:hover {
opacity: 1;
}

0 个答案:

没有答案