在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML/ 【css】如何解決css transition的動(dòng)畫(huà)圖片放大之后 然后會(huì)引起圖片

【css】如何解決css transition的動(dòng)畫(huà)圖片放大之后 然后會(huì)引起圖片閃動(dòng)的情況

RT

部分css代碼如下:

        #img2{width: 188px;height: 188px;transition: all 1s;backface-visibility: hidden;}
        #img2:hover{width: 188px;height: 188px;-webkit-transform: scale(2);position: relative;left: 100px;top: 100px ;z-index: 10;}
回答
編輯回答
生性
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style type="text/css">
  #img {
    width: 300px;
    height: 300px;
    margin: 100px auto;
    background: red;
  }
#img2 {
    width: 188px;
    height: 188px;
    backface-visibility: hidden;
    transition: all 1s ease;
    background: orange;
}
  #img:hover #img2 {
    transform: scale(2) translate(100px, 100px);
  }
  </style>
</head>

<body>
  <div id="img">
    <div id="img2"></div>
  </div>
</body>

</html>

copy 到 文件執(zhí)行下就可以了

2017年10月31日 03:12
編輯回答
爆扎
#img2{width: 188px;height: 188px;transition: all 1s;backface-visibility: hidden;position: relative;left: 100px;top: 100px ;z-index: 10;}
#img2:hover{-webkit-transform: scale(2);}

這樣就可以了,hover時(shí)圖片位置變化了,導(dǎo)致一直在重復(fù)hover,還有為啥hover的時(shí)候定位??

2017年6月22日 18:56