我想在比例0.06 to 1
上順利縮放div,在mouseover上使用css。但我無法獲得該效果。如何在css中使用關鍵幀順利地縮放div
這是我曾嘗試
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background: red;
-webkit-transition: transform 2s; /* For Safari 3.1 to 6.0 */
transition: width 2s, height 4s;
}
div:hover {
transform:scaleX(0.06);
animation-name: example;
animation-duration: 1s;
}
@keyframes example {
25% {transform:scaleX(0.200);}
50% {transform:scaleX(0.500);}
75% {transform:scaleX(0.700);}
100% {transform:scaleX(1);}
}
</style>
</head>
<body>
<p><b>Note:</b> This example does not work in Internet Explorer 9 and earlier versions.</p>
<div>jhk</div>
<p>Hover over the div element above, to see the transition effect.</p>
</body>
</html>
我怎樣才能做到這一點?