Created
August 17, 2012 14:51
-
-
Save fregante/3379426 to your computer and use it in GitHub Desktop.
Switch CSS background instead of resizing it. With media queries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html{ | |
background: url(res/bg/1280.jpg) fixed center black; | |
} | |
@media only screen and (min-width:1281px), | |
only screen and (min-height:801px) { | |
html{ background-image: url(res/bg/1366.jpg); } | |
} | |
@media only screen and (min-width:1367px), | |
only screen and (min-height:855px) { | |
html{ background-image: url(res/bg/1440.jpg); } | |
} | |
@media only screen and (min-width:1441px), | |
only screen and (min-height:901px) { | |
html{ background-image: url(res/bg/1680.jpg); } | |
} | |
@media only screen and (min-width:1681px), | |
only screen and (min-height:1051px) { | |
html{ background-image: url(res/bg/1920.jpg); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment