Skip to content

Instantly share code, notes, and snippets.

@joeellis
Last active December 25, 2015 00:19
Show Gist options
  • Save joeellis/6886653 to your computer and use it in GitHub Desktop.
Save joeellis/6886653 to your computer and use it in GitHub Desktop.
A Pen by Joe Ellis.
<div class="home">
...
</div>
<div class="work">
...
</div>
<div class="about">
...
</div>
%section-background {
width: 100%;
height: 500px;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.home {
@extend %section-background;
background: url(home.jpg) center center no-repeat;
}
.work {
@extend %section-background;
background: url(work.jpg) center center no-repeat;
}
.about {
@extend %section-background;
background: url(about.jpg) center center no-repeat;
}
@alexcarpenter
Copy link

Yeah, this is another great example. I may pull out the background position and no-repeat into the section-background as well though. Nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment