CSS3 トランジションについて学んでいて、ベンダー プレフィックスに苦労しています。これは単なる楽しみですが、Firefoxではホバー時に円が拡大するのに、SafariとChromeでは縮小する理由を知りたいです。Webkit は幅と高さを無視しているようですが、境界線と不透明度は問題ありません。通常状態のアニメーションも問題ないようです。
を変更して.disc:hover
width
みましたが、トランジションをwidth
の代わりに変更してみましたall
(動作しているようです) all
。
ページへのリンク: http://ambigraph.com/sketchbook/expando/
HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Expando</title>
<link href="expando.css" rel="stylesheet" type="text/css">
</head>
<body ontouchstart="">
<div class="disc">
</div>
</body>
</html>
CSS:
@keyframes expando {
0% {
width:50px;
height:50px;
color:#009;
}
100% {
width:30px;
height:30px;
color:black;
}
}
@-webkit-keyframes expando {
0% {
width:50px;
height:50px;
color:#009;
}
100% {
width:30px;
height:30px;
color:black;
}
}
body {
margin: 0 auto;
}
.disc {
position: absolute;
top:0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
border-radius:300px;
width:50px;
height:50px;
border:50px double;
opacity:1;
-webkit-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
-webkit-animation:expando .5s ease infinite alternate;
animation:expando .5s ease infinite alternate;
}
.disc:hover {
position: absolute;
top:0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
cursor:pointer;
border:2px double;
opacity:0;
width:300px;
height:300px;
}