-
-
Save gcyrillus/5691891 to your computer and use it in GitHub Desktop.
preserve3d for a fake box
This file contains 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
/* preserve3d for a fake box */ | |
html { | |
display:table; | |
width:100%;height:100%; | |
background: #f06; | |
background: linear-gradient(45deg, yellow, #f06);min-height: 100%; | |
} | |
body { | |
display:table-cell; | |
vertical-align:middle; | |
} | |
div {perspective: 100px; | |
transform-style: preserve-3d; | |
height:50px; | |
line-height:50px; | |
text-align:center; | |
color:white; | |
font-size:1.5em; | |
font-weight:bold; | |
width:200px; | |
background:#aaa; | |
margin: 8px auto; | |
position:relative; | |
z-index:1; | |
box-shadow: 0 0 1px, inset 0 0 45px white; | |
text-shadow:-1px -1px black, 1px 1px gray; | |
border-radius:3px; | |
} | |
div:before, div:after { | |
position:absolute; | |
content:''; | |
background:#999; | |
position:absolute; | |
z-index:-1; | |
top:0px; | |
left:0; | |
bottom:0px; | |
width:12px; | |
transform-origin: 0% 100%; | |
transform: rotateY(160deg) skewY(-30deg); | |
box-shadow: 0 0 1px, 0 0 15px -3px white, 400px 0 200px 120px #84d204; | |
border-radius:3px; | |
} | |
div:after { | |
background:gray; | |
width:202px; | |
top:-6px; | |
bottom:50px; | |
left:-9px; | |
transform-origin: 0% 0%; | |
transform: skewx(50deg); | |
} |
This file contains 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
<div>Un div </div> | |
<div>Un autre </div> | |
<div>Un div </div> | |
<div>Un autre </div> |
This file contains 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
// alert('Hello world!'); |
This file contains 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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment