Skip to content

Instantly share code, notes, and snippets.

@yoksel
Created September 29, 2013 08:35
Show Gist options
  • Save yoksel/6750483 to your computer and use it in GitHub Desktop.
Save yoksel/6750483 to your computer and use it in GitHub Desktop.
Banner
.ribbon {
position: relative;
width: 80%;
min-width: 300px;
margin: 3em auto;
}
H1 {
margin: 0 1em;
background: orangered;
font-weight: normal;
line-height: 1.7em;
text-align: center;
text-shadow: 0 0 2px rgba(0,0,0,.4);
box-shadow: 0 3px 5px rgba(0,0,0,.2);
color: #FFF;
}
.ribbon:before,
.ribbon:after,
H1:before,
H1:after {
content: "";
display: block;
position: absolute;
width: 0;
height: 0;
}
.ribbon:before,
.ribbon:after {
top: 1.4em;
z-index: -2;
border: 1.6em solid orangered;
}
.ribbon:before {
left: 0;
border-left-color: transparent;
}
.ribbon:after {
right: 0;
border-right-color: transparent;
}
H1:before,
H1:after {
top: 1.7em;
z-index: -1;
border: .3em solid crimson;
border-bottom-color: transparent;
}
H1:before {
left: 1em;
border-left-color: transparent;
}
H1:after {
right: 1em;
border-right-color: transparent;
}
BODY {
background: white;
}
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<div class="ribbon"><h1>Я ленточка</h1></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment