
Originally Posted by
jakash
How would I go about creating a query that would serve up a smaller image that will work on idevices but give the regular large image to everything else.
Firstly, I'd advise you to add this to the <head> of your document:
Code:
<meta name="viewport" content="width=device-width;">
It's a good idea to include that on all sites to help mobile displays.
Then, in your style sheet, put something like this:
Code:
@media only screen and (max-width: 480px) {
body {background: url(/images/small-bg.jpg) no-repeat 50% 0;}
}
to target smartphones, or to catch devices like iPad in one hit, something like
Code:
@media only screen and (max-width: 1024px) {
body {background: url(/images/small-bg.jpg) no-repeat 50% 0;}
}
Bookmarks