Last active
June 14, 2017 10:42
-
-
Save kkeeth/293f54809e1cd030ecb40f128b3d7cda to your computer and use it in GitHub Desktop.
css3で遊んだものリスト
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 name="viewport" content="width=device-width, initial-scale=1.0"/> | |
<style> | |
body { | |
background-color: bisque; | |
} | |
#container { | |
position: relative; | |
width: 300px; | |
margin: 50px auto; | |
text-align: center; | |
background-color: #fff; | |
} | |
.contents { | |
position: absolute; | |
width: 300px; | |
height: 400px; | |
left: 0; | |
background: #fff; | |
border: 1px solid #ccc; | |
} | |
.contents:before, | |
.contents:after { | |
content: ""; | |
position: absolute; | |
width: 100%; | |
height: 100%; | |
left: 0; | |
background: #fff; | |
-webkit-transition: all 1s ease-in-out; | |
-moz-transition: all 1s ease-in-out; | |
-ms-transition: all 1s ease-in-out; | |
-o-transition: all 1s ease-in-out; | |
} | |
.contents:hover:before, | |
.contents:hover:after { | |
z-index: -1; | |
border: 1px solid #ddd; | |
-webkit-transform: rotateZ(4deg); | |
-moz-transform: rotateZ(4deg); | |
-ms-transform: rotateZ(4deg); | |
-o-transform: rotateZ(4deg); | |
} | |
.contents:hover:after { | |
top: 3px; | |
border: 1px solid #eee; | |
z-index: -2; | |
-webkit-transform: rotateZ(-3deg); | |
-moz-transform: rotateZ(-3deg); | |
-ms-transform: rotateZ(-3deg); | |
-o-transform: rotateZ(-3deg); | |
} | |
</style> | |
</head> | |
<body> | |
<div id="container"> | |
<div class="contents"></div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment