Skip to content

Instantly share code, notes, and snippets.

@zincplusplus
Created January 4, 2012 10:43
Show Gist options
  • Save zincplusplus/1559517 to your computer and use it in GitHub Desktop.
Save zincplusplus/1559517 to your computer and use it in GitHub Desktop.
Ribbon
/**
* Ribbon
**/
.xribbon {
font-family: Verdana, Arial, sans;
position: relative;
text-align: center;
}
.xribbon,
.xribbon .xheader .xtitle,
.xribbon .xfold {
font-size: 40px;
}
.xribbon .xheader {
display: inline-block;
margin: 0 1em;
position: relative;
}
.xribbon .xfold,
.xribbon .xfold:after,
.xribbon .xheader .xtitle {
border: 1px dashed #fc0;
border-left: 0 none;
border-right: 0 none;
box-shadow: 0 -1px 0 #e30404,/* outline top */
0 1px 0 #e30404;/* outline bottom */
}
.xribbon .xheader .xtitle
{
background-color: #e30404;
background-image: linear-gradient(left, rgba(0,0,0,.1), transparent); /* texture */
background-size: 4px 1px;
color: #fff;
display: inline-block;
font-weight: bold;
height: 1.4em;
line-height: 1.3em;
padding: 0 1em;
position: relative;
text-shadow: 0 2px 1px rgba(0,0,0,0.3);
text-transform: uppercase;
z-index: 100;
}
.xribbon .xfold {
background-image: linear-gradient(left, transparent 40%, rgba(0,0,0,0.6) 100%),
linear-gradient(left, rgba(0,0,0,.1), transparent);
background-size: 100% 100%, 4px 1px;
background-color: red;
height: 1.5em;
mask-image: -ms-gradient(linear, 0 0, 100% 100%, from(rgba(0,0,0,0)), color-stop(50%,rgba(0,0,0,0)), color-stop(50%,rgba(0,0,0,1)), to(rgba(0,0,0,1))),
-ms-gradient(linear, 100% 0, 0 100%, from(rgba(0,0,0,1)), color-stop(50%,rgba(0,0,0,1)), color-stop(50%,rgba(0,0,0,0)), to(rgba(0,0,0,0)));
mask-image: -moz-gradient(linear, 0 0, 100% 100%, from(rgba(0,0,0,0)), color-stop(50%,rgba(0,0,0,0)), color-stop(50%,rgba(0,0,0,1)), to(rgba(0,0,0,1))),
-moz-gradient(linear, 100% 0, 0 100%, from(rgba(0,0,0,1)), color-stop(50%,rgba(0,0,0,1)), color-stop(50%,rgba(0,0,0,0)), to(rgba(0,0,0,0)));
mask-image: -o-gradient(linear, 0 0, 100% 100%, from(rgba(0,0,0,0)), color-stop(50%,rgba(0,0,0,0)), color-stop(50%,rgba(0,0,0,1)), to(rgba(0,0,0,1))),
-o-gradient(linear, 100% 0, 0 100%, from(rgba(0,0,0,1)), color-stop(50%,rgba(0,0,0,1)), color-stop(50%,rgba(0,0,0,0)), to(rgba(0,0,0,0)));
mask-image: -webkit-gradient(linear, 0 0, 100% 100%, from(rgba(0,0,0,0)), color-stop(50%,rgba(0,0,0,0)), color-stop(50%,rgba(0,0,0,1)), to(rgba(0,0,0,1))),
-webkit-gradient(linear, 100% 0, 0 100%, from(rgba(0,0,0,1)), color-stop(50%,rgba(0,0,0,1)), color-stop(50%,rgba(0,0,0,0)), to(rgba(0,0,0,0)));
mask-image: gradient(linear, 0 0, 100% 100%, from(rgba(0,0,0,0)), color-stop(50%,rgba(0,0,0,0)), color-stop(50%,rgba(0,0,0,1)), to(rgba(0,0,0,1))),
gradient(linear, 100% 0, 0 100%, from(rgba(0,0,0,1)), color-stop(50%,rgba(0,0,0,1)), color-stop(50%,rgba(0,0,0,0)), to(rgba(0,0,0,0)));
position: absolute;
top: 0.25em;
width: 2.5em;
}
.xribbon .xfold:after {
background: #e30404;
box-shadow: inset 0 0 100px 0 rgba(0,0,0,0.3);
content: "";
display: block;
height:1.4em;
position: absolute;
right: 0;
transform: skewY(16deg);
top: -0.12em;
width: 1em;
}
.xribbon .xleft {
left: -1.5em;
}
.xribbon .xright {
transform: scalex(-1);
right: -1.5em;
}
.xribbon .xheader .xtitle:before,
.xribbon .xheader .xtitle:after {
color: #fc0;
content: "*";
display: block;
font-size: 0.4em;
font-weight: normal;
height: 1px;
line-height: 3.75em;
position: absolute;
text-align: center;
text-shadow: 0 2px 0 rgba(0,0,0,0.3);
top: 0;
width: 2.5em;
}
.xribbon .xheader .xtitle:before {
left: 0px;
}
.xribbon .xheader .xtitle:after {
right: 0px;
}
.xribbon .xtagline {
font-size: 0.3em;
margin: 0.125em 0;
opacity: 0.8;
text-shadow: 0 1px 0 rgba(0,0,0,.5);
}
<div id="xmas">
<div class="xribbon">
<div class="xheader">
<span class="xtitle">Title goes here</span>
<span class="xfold xleft"></span>
<span class="xfold xright"></span>
</div>
<div class="xtagline">Tagline goes here</div>
</div>
</div>
{"view":"split","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment