Skip to content

Instantly share code, notes, and snippets.

@davydog187
Created April 28, 2015 18:54
Show Gist options
  • Save davydog187/ec2b7050477657c14a0b to your computer and use it in GitHub Desktop.
Save davydog187/ec2b7050477657c14a0b to your computer and use it in GitHub Desktop.
Responsvie background images
<!DOCTYPE html>
<html>
<head>
<style>
.small div {
width:200px;
height:75px;
}
.medium div {
width: 400px;
height: 75px;
}
.medium {
display: none;
}
.small {
display: none;
}
@media all and (min-width: 0) and (max-width: 600px) {
.small {
display: block;
}
}
@media all and (min-width: 601px) and (max-width: 1000px){
.medium {
display: block;
}
}
</style>
</head>
<body>
<a href="http://reddit.com" class="small">
<div style="background-image:url('http://www.stuff.co.nz/etc/designs/ffx/nz/stuff/social-media-logos/stuff-180x180.jpg')"></div>
</a>
<a href="http://bloomberg.com" class="medium">
<div style="background-image:url('http://upload.wikimedia.org/wikipedia/commons/6/6a/Eric_Holder_official_portrait.jpg')"></div>
</a>
</body>
<html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment