-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathandroid_vs_ipad_iphone.txt
More file actions
40 lines (25 loc) · 1.26 KB
/
android_vs_ipad_iphone.txt
File metadata and controls
40 lines (25 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
I have been working on finding a way to target Androids or iPads/iPhones (separately)
and this one I have worked out appears to do the job nicely.
This one is one I just made this weekend. It targets webkit (chrome/safari/android browser)
but this one segregates itself from iOS devices. In other words, this one works on Android and
Desktop/Laptop devices but not on iPad/iPhone.
/*
Safari 5.1+, Chrome 15+, Android Browser 4+ (Android OS 4.0+[4.0.4+], not iOS)
Tested on Android 4.0.4+
Desktops, Laptops, Mobiles
*/
_:-webkit-full-screen, :root .selector { property:value; }
If you wish to target hi-def mobiles, but not desktops/laptops:
/* Chrome 15+, Android Browser 4+ (Android OS 4.0+[4.0.4+], not iOS) */
/* Mobiles (High-Definition) */
@media screen and (-webkit-min-device-pixel-ratio:1.1) {
_:-webkit-full-screen, .selector { property:value; }
}
Or conversely, if you wish to avoid hi-def mobiles but target desktops (and old non-hi-definition mobiles)
this should do the trick:
/* Safari 5.1+, Chrome 15+, Android Browser 4+ (Android OS 4.0+[4.0.4+], not iOS) */
/* Desktops, Laptops, Old Mobiles (Not High-Definition) */
@media screen and (-webkit-max-device-pixel-ratio:1) {
_:-webkit-full-screen, .selector { property:value; }
}
--Jeff