我希望此按钮在悬停时具有边框(如此fiddle所示)。它实际上做我想做的事情,但它在Chrome和Firefox上抖动太多(IE10似乎完美地工作)。导致抖动的CSS悬停上的负边距
这是什么原因,以及如何处理在过渡期间不会出现抖动的解决方案?
HTML:
<div id="container">
<div class="round_bt_container">
<div class="round_bt" style="background-image:url(http://edinhopiscinas.com.br/img/img1.png);background-size:160px;background-position:center center;background-repeat:no-repeat;">
</div>
</div>
</div>
CSS:
#container{
width:80%;
height:80%;
position:absolute;
padding:10%;
background-image:url(http://edinhopiscinas.com.br/img/bg.jpg);
}
.round_bt_container{
cursor:pointer;
position:relative;
float:left;
margin-right:40px;
border-radius:50%;
border:5px solid #ffffff;
box-shadow:2px 1px 15px -9px #000000;
width:160px;
height:160px;
-webkit-transition:all 0.2s ease;
-ms-transition: all 0.2s ease;
-moz-transition:all 0.2s ease;
-o-transition:all 0.2s ease;
transition:all 0.2s ease;
}
.round_bt{
position:absolute;
border-radius:50%;
width:160px;
height:160px;
padding:0;
margin:0;
border:0px solid #eeeeee;
-webkit-transition:all 0.2s ease;
-ms-transition: all 0.2s ease;
-moz-transition:all 0.2s ease;
-o-transition:all 0.2s ease;
transition:all 0.2s ease;
}
.round_bt img{
border-radius:50%;
}
.round_bt_container:hover .round_bt{
width:160px;
height:160px;
border:5px solid #f98523;
padding:15px;
margin-left:-20px;
margin-top:-20px;
}
.round_bt_container:hover{
border:2px solid #ffcfa7;
margin-left:3px;
margin-top:3px;
}
从百分比上的#container改变填充,以像素(或EMS )在Chrome中有帮助:http://jsfiddle.net/zcPVj/17/ – superUntitled
是的,但FF和IE10仍然使用此解决方案抖动。 –
结帐我的第二次编辑 –