Skip to content

Instantly share code, notes, and snippets.

@ludviglindblom
Created December 21, 2011 12:24
Show Gist options
  • Save ludviglindblom/1505843 to your computer and use it in GitHub Desktop.
Save ludviglindblom/1505843 to your computer and use it in GitHub Desktop.
CSS3 Ribbon
/**
* CSS3 Ribbon
*/
body{
text-align: center;
}
body a, body a:link, body a:active, body a:visited{
color: #1169C1;
text-shadow: 1px 1px 0 #ccc;
font: bold 12px Arial, Helvetica, sans-serif;
}
body a:hover{
text-decoration: none;
color: #000;
text-shadow: 0;
}
.box{
width: 220px;
padding: 70px 0 10px 0;
background: linear-gradient(top, #cdeb8e 0%,#a5c956 100%);
margin: 100px auto 10px auto;
position: relative;
/* typo */
font: 14px/1.5em Georgia, "Times New Roman", serif;
color: #000;
text-shadow: 1px 1px 0 #fff;
text-align: left;
}
.box p{
margin: 0 10px 10px 10px;
}
.ribbon{
width: 240px;
height: 26px;
background: linear-gradient(top, #7abcff 0%,#60abf3 44%,#4096ee 100%);
box-shadow: 0px 1px 5px #999;
position: absolute;
top: 10px;
left: -10px;
/* typo */
color: #fff;
text-shadow: 1px 1px 0 #000;
text-align: center;
padding: 4px 0 0 0;
font: bold 15px Georgia, "Times New Roman", serif;
}
.ribbon:before{
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right:10px solid #1169C1;
content: "";
position: absolute;
top: 20px;
left: 0;
z-index: -1;
}
.ribbon:after{
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-left: 10px solid #1169C1;
content: "";
position: absolute;
top: 20px;
right: 0;
z-index: -1;
}
<!-- content to be placed inside <body>…</body> -->
<div class="box">
<h3 class="ribbon">CSS3 ribbon</h3>
<p>The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee.</p>
</div>
CSS3 ribbon by <a href="http://www.agdizajn.com">Aleksandar Goševski</a>
{"view":"split-vertical","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment