Last active
August 29, 2015 13:56
-
-
Save katsumitakano/9019655 to your computer and use it in GitHub Desktop.
CSS3 Transition Sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="ja"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>アニメーションのサンプル</title> | |
| <link href="style.css" rel="stylesheet" type="text/css" /> | |
| </head> | |
| <body> | |
| <div class="box bgcolor">bgcolor</div> | |
| <div class="box double">double</div> | |
| <div class="box move">move</div> | |
| <div class="box complex">complex</div> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .box { | |
| margin: 30px; | |
| width: 80px; | |
| height: 80px; | |
| background: #666; | |
| color: white; | |
| } | |
| .bgcolor { | |
| transition: background 0.5s ease 0s; | |
| } | |
| .bgcolor:hover { | |
| background: red; | |
| } | |
| .double { | |
| transition: background 0.5s ease 0s, width 0.5s ease 0s; | |
| } | |
| .double:hover { | |
| background: red; | |
| width: 200px; | |
| } | |
| .move { | |
| transition: -webkit-transform 1s ease-out 0s; | |
| } | |
| .move:hover { | |
| -webkit-transform: translate(100px, 0); | |
| } | |
| .complex { | |
| transition: all 1s ease-out 0s; | |
| } | |
| .complex:hover { | |
| -webkit-transform: scale(2) rotate(30deg) skew(30deg); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment