Skip to content

Instantly share code, notes, and snippets.

@thingsinjars
Created January 31, 2012 13:25
Show Gist options
  • Save thingsinjars/1710454 to your computer and use it in GitHub Desktop.
Save thingsinjars/1710454 to your computer and use it in GitHub Desktop.
Background size cover and contain examples
div {
width: 75px;
height: 100px;
background: black url('http://www.developer.nokia.com/Community/Piazza/images/Blog-Icon.png') no-repeat 50%;
background-size: contain;
}
div {
width: 100px;
height: 100px;
background: black url('http://www.developer.nokia.com/Community/Piazza/images/Blog-Icon.png') no-repeat 50%;
background-size: cover;
}
div {
width: 75x;
height: 100px;
background: black url('http://www.developer.nokia.com/Community/Piazza/images/Blog-Icon.png') no-repeat 50%;
background-size: cover;
}
div {
width: 180px;
height: 100px;
background: black url('http://www.developer.nokia.com/Community/Piazza/images/Blog-Icon.png') no-repeat 50%;
background-size: cover;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment