Skip to content

Instantly share code, notes, and snippets.

@brenna
Created September 14, 2012 20:06
Show Gist options
  • Save brenna/3724385 to your computer and use it in GitHub Desktop.
Save brenna/3724385 to your computer and use it in GitHub Desktop.
Keylines with :before and :after
.find-parking {
width: 100%;
padding: 20px 0;
overflow: hidden;
background: #92b63c;
background: -moz-linear-gradient(top, #92b63c 0%, #608c1e 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #92b63c), color-stop(100%, #608c1e));
background: -webkit-linear-gradient(top, #92b63c 0%, #608c1e 100%);
background: -o-linear-gradient(top, #92b63c 0%, #608c1e 100%);
background: -ms-linear-gradient(top, #92b63c 0%, #608c1e 100%);
background: linear-gradient(to bottom, #92b63c 0%, #608c1e 100%);
}
h2 {
position: relative;
width: 180px;
margin: 0 auto;
color: #fff;
font-size: 20px;
font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Helvetica, sans-serif;
text-align: center;
text-transform: uppercase;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}
h2:before,
h2:after {
content: "";
position: absolute;
top: 50%;
width: 300px;
height: 0;
border-top: solid 1px #68832a;
border-bottom: solid 1px #a8d244;
}
h2:before {
right: 100%;
}
h2:after {
left: 100%;
}​
<div class="find-parking">
<h2>Find Parking</h2>
</div>​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment