Reputation: 1601
Well does anyone know of a javascript that detects whether a user is using a mobile phone or a normal computer and then resizes the window to fit that device, if it cant be done with javascript does anyone know a way in which it can be done.
Thanks for any help that ye can give
Upvotes: 1
Views: 2161
Reputation: 999
I use these:
/* Non-Retina */
@media screen and (-webkit-max-device-pixel-ratio: 1) {
}
/* Retina */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
}
/* iPhone Portrait */
@media screen and (max-device-width: 480px) and (orientation:portrait) {
}
/* iPhone Landscape */
@media screen and (max-device-width: 480px) and (orientation:landscape) {
}
/* iPad Portrait */
@media screen and (min-device-width: 481px) and (orientation:portrait) {
}
/* iPad Landscape */
@media screen and (min-device-width: 481px) and (orientation:landscape) {
}
http://zsprawl.com/iOS/2012/03/css-for-iphone-ipad-and-retina-displays/
Upvotes: 0
Reputation: 5558
Nice article from smashing magazine
eq.
@media only screen and (max-device-width: 480px) {
// insert styling here…
}
Upvotes: 2