Skip to content

Instantly share code, notes, and snippets.

@justinthrelkeld
Created May 20, 2014 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinthrelkeld/d7d0b6963146ff310a72 to your computer and use it in GitHub Desktop.
Save justinthrelkeld/d7d0b6963146ff310a72 to your computer and use it in GitHub Desktop.
Fade to black image hero straps
// defines .row--hero class for edgless, fade to black image straps
=edgeless-background($image)
background: -moz-linear-gradient(left, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,1) 90%, rgba(0,0,0,1) 100%), url($image) no-repeat center top /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(0,0,0,1)), color-stop(10%,rgba(0,0,0,1)), color-stop(30%,rgba(0,0,0,0)), color-stop(70%,rgba(0,0,0,0)), color-stop(90%,rgba(0,0,0,1)), color-stop(100%,rgba(0,0,0,1))), url($image) no-repeat center top /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, rgba(0,0,0,1) 0%,rgba(0,0,0,1) 10%,rgba(0,0,0,0) 30%,rgba(0,0,0,0) 70%,rgba(0,0,0,1) 90%,rgba(0,0,0,1) 100%), url($image) no-repeat center top /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(0,0,0,1) 0%,rgba(0,0,0,1) 10%,rgba(0,0,0,0) 30%,rgba(0,0,0,0) 70%,rgba(0,0,0,1) 90%,rgba(0,0,0,1) 100%), url($image) no-repeat center top /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(0,0,0,1) 0%,rgba(0,0,0,1) 10%,rgba(0,0,0,0) 30%,rgba(0,0,0,0) 70%,rgba(0,0,0,1) 90%,rgba(0,0,0,1) 100%), url($image) no-repeat center top /* IE10+ */
background: linear-gradient(to right, rgba(0,0,0,1) 0%,rgba(0,0,0,1) 10%,rgba(0,0,0,0) 30%,rgba(0,0,0,0) 70%,rgba(0,0,0,1) 90%,rgba(0,0,0,1) 100%), url($image) no-repeat center top /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#000000', endColorstr='#000000',GradientType=1 )
background-size: 1850px
background-position: center top
background-color: black
.row--hero
.row__inner
height: 500px
line-height: 500px
> *
line-height: 1.45em
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment