Skip to content

Instantly share code, notes, and snippets.

@veewee
Created March 21, 2014 13:11
Show Gist options
  • Save veewee/9685863 to your computer and use it in GitHub Desktop.
Save veewee/9685863 to your computer and use it in GitHub Desktop.
Add a background-image to the element and this mixin will make sure that the image is cropped and displayed nicely.
@mixin crop-and-center-background-image($width, $height) {
display: block;
width: $width;
height: $height;
background-position: center center;
background-size: cover;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment