Created
January 10, 2016 09:01
-
-
Save bluzky/60a172ac0ccd01364054 to your computer and use it in GitHub Desktop.
CSS ribbon
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
.ribbon-container{ | |
width: 300px; | |
height: 300px; | |
background: #FFF; | |
} | |
.ribbon-container .ribbon{ | |
position:relative; | |
color:#fff; | |
background:#f43059; | |
font-size:1.5em; | |
padding:10px 10px 10px 20px; | |
margin-bottom:20px; | |
text-shadow:0 -1px #d0284b, 0 1px #f96080; | |
-moz-box-shadow:2px 2px 0 rgba(0,0,0,0.1); | |
-webkit-box-shadow:2px 2px 0 rgba(0,0,0,0.1); | |
-o-box-shadow:2px 2px 0 rgba(0,0,0,0.1); | |
box-shadow:2px 2px 0 rgba(0,0,0,0.1); | |
} | |
.ribbon-container .ribbon:before{ | |
content:" "; | |
display:block; | |
position:absolute; | |
bottom:0; | |
margin-bottom:-10px; | |
z-index:-1; | |
} | |
.ribbon-container .top-left{ | |
margin-left:-20px; | |
float:left; | |
clear: both; | |
} | |
.ribbon-container .top-left::before{ | |
content: ""; | |
width: 0; | |
height: 0; | |
border-style: solid; | |
border-width: 0 10px 10px 0; | |
border-color: transparent #007bff transparent transparent; | |
left:0; | |
right: auto; | |
} | |
.ribbon-container .top-right{ | |
margin-right:-20px; | |
float:right; | |
clear: both; | |
} | |
.ribbon-container .top-right::before{ | |
content:" "; | |
width: 0; | |
height: 0; | |
border-style: solid; | |
border-width: 10px 10px 0 0; | |
border-color: #007bff transparent transparent transparent; | |
left:auto; | |
right: 0; | |
} | |
.ribbon{ | |
position:relative; | |
color:#fff; | |
background:#f43059; | |
font-size:1.5em; | |
float:right; | |
clear:both; | |
padding:10px 10px 10px 20px; | |
margin-right:-20px; | |
margin-bottom:20px; | |
text-shadow:0 -1px #d0284b, 0 1px #f96080; | |
-moz-box-shadow:2px 2px 0 rgba(0,0,0,0.1); | |
-webkit-box-shadow:2px 2px 0 rgba(0,0,0,0.1); | |
-o-box-shadow:2px 2px 0 rgba(0,0,0,0.1); | |
box-shadow:2px 2px 0 rgba(0,0,0,0.1); | |
} | |
.ribbon:before{ | |
content:" "; | |
width: 0; | |
height: 0; | |
border-style: solid; | |
border-width: 10px 10px 0 0; | |
border-color: #007bff transparent transparent transparent; | |
display:block; | |
position:absolute; | |
bottom:0; | |
left:auto; | |
right: 0; | |
margin-bottom:-10px; | |
z-index:-1; | |
} |
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="ribbon-container"> | |
<div class="ribbon top-right"> | |
HELLO CO BA | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment