Skip to content

Instantly share code, notes, and snippets.

@cesardanielhg
Created September 29, 2013 05:24
Show Gist options
  • Save cesardanielhg/6749618 to your computer and use it in GitHub Desktop.
Save cesardanielhg/6749618 to your computer and use it in GitHub Desktop.
A Pen by cesardanielhg.
<div class="box">
<div class="pusher"></div>
<div class="box-small">
<div class="content">Breaking Bad.</div>
<div class="background blurry"></div>
<div class="background translucent"></div>
</div>
</div>
<p>The height of '.pusher' can be adjusted and the translucent/blurry background still works.</p>
@import "compass";
body {
font-family: Helvetica, Arial;
padding: 0;
margin: 0;
color: #222;
}
.pusher {
height: 100px;
}
.box {
display: block;
width: 460px;
height: 276px;
background-image: url(http://static.guim.co.uk/sys-images/Guardian/Pix/pixies/2012/8/30/1346345106154/Breaking-Bad-008.jpg);
}
.box-small {
text-align: center;
border-radius: 5px;
display: block;
padding: 20px 0;
width: 80%;
margin: 0 auto;
position: relative;
font-size: 20px;
font-weight: bold;
}
.background {
border-radius: 4px;
height: 100%;
width: 100%;
position: absolute;
top: 0;
}
.content {
position: relative;
z-index: 1;
}
.translucent {
background-color: rgba(255,255,255,0.5);
border:4px solid #fff;
box-shadow: 0 0 10px #000;
}
.blurry {
background-attachment: fixed;
background-image: url(http://static.guim.co.uk/sys-images/Guardian/Pix/pixies/2012/8/30/1346345106154/Breaking-Bad-008.jpg);
-webkit-filter: blur(10px);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment