■プロパティに変化があった際に用いる、簡単な動作に適している
・疑似クラス :hover など変化など
■DEMO
ホバーするとボックスが四角から丸にかわる
<html>
1 |
<div class="box"><p>DEMO<p/></div> |
<css>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
.box { width: 100px; height: 100px; background: #000; transition: all 300ms 0s ease; } .box:hover { background: #ccc; width: 100px; border-radius: 100%; } p{ color: #fff; height: 100px; line-height: 100px; text-align: center; } |
■参考
CSSアニメーション 入門
コメント