Last active
January 3, 2016 20:49
-
-
Save centurianii/8517270 to your computer and use it in GitHub Desktop.
Tucked corners
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
/** | |
* Tucked corners | |
*/ | |
.tucked-corners-top { | |
position: relative; | |
width: 500px; min-height: 200px; | |
margin: 50px auto; padding: 20px; | |
background-color: #cccccc; /* Fallback */ | |
background: linear-gradient(45deg, transparent 10px, #cccccc 10px), | |
linear-gradient(135deg, transparent 10px, #cccccc 10px), | |
linear-gradient(225deg, transparent 10px, #cccccc 10px), | |
linear-gradient(315deg, transparent 10px, #ccc 10px); | |
background-position: bottom left, bottom right, top right, top left; | |
background-size: 50% 50%; | |
background-repeat: no-repeat; | |
box-shadow: 0 20px 10px -20px rgba(0, 0, 0, .5); | |
} | |
[class*='tucked-corners-']::before, /* All the four corners */ | |
[class*='tucked-corners-']::after { | |
content: ''; | |
position: absolute; | |
height: 20px; width: 80px; | |
box-shadow: 0 8px 15px -7px rgba(0, 0, 0, .5); | |
box-shadow: none\9; /* Do not show on IE9 #needed */ | |
} | |
.tucked-corners-top::before, /* Top left & top right */ | |
.tucked-corners-top::after { | |
top: -10px; | |
} | |
.tucked-corners-bottom::before, /* Bottom left & bottom right */ | |
.tucked-corners-bottom::after { | |
bottom: -10px; | |
} | |
.tucked-corners-top::before, /* Top left & bottom left */ | |
.tucked-corners-bottom::before { | |
left: -42px; | |
} | |
.tucked-corners-top::after, /* Top right & bottom right */ | |
.tucked-corners-bottom::after { | |
right: -42px; | |
} | |
.tucked-corners-top::before { /* Top left */ | |
transform: rotate(-45deg); | |
} | |
.tucked-corners-top::after { /* Top right */ | |
transform: rotate(45deg); | |
} | |
.tucked-corners-bottom::before { /* Bottom left */ | |
transform: rotate(-135deg); | |
} | |
.tucked-corners-bottom::after { /* Bottom right */ | |
transform: rotate(135deg); | |
} |
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 class="tucked-corners-top"> | |
<div class="tucked-corners-bottom"> | |
<h1>Director's corner (quiet please!)</h1> | |
<a href="http://www.red-team-design.com/css3-tucked-corners">www.red-team-design.com</a> | |
</div> | |
</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","fontsize":"100","seethrough":"","prefixfree":"","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment