-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathstyle.css
131 lines (116 loc) · 3.88 KB
/
style.css
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
* Using media queries for a responsive design becomes tricky now that a portrait iphone/ipod
* reports width:480px and a portrait ipad reports width:1024px.
*
* In this section we showcase the most common media queries people use in responsive designs
* and how to rewrite them to target iOS correctly after the bug fix hack.
*/
/* base */
body { background: #11;}
h3:after { content: 'Less than 320px. Can be an old IE or a feature phone.';}
/* portrait phone */
@media screen and (min-width: 320px) {
body { background: #444; }
h3:after { content: 'More than 320px. Usually a portrait phone.';}
}
/* landscape phone:
usually people do this:
@media screen and (min-width: 480px)
we need a new expression that doesn't match portrait iphone that now wrongly reports width:480px.
below, the first expression target all normal phones where a 480px device-width will mean a 480px width.
the second expression targets iphone in landscape; for precaution, we restrict the device dimensions exactly
to 320x480 an then look for a big reported width (480) with a low height (320 max), meaning we are in landscape.
(note: we don't use (orientation:landscape) here since old iOS devices don't support this)
*/
@media screen and (min-width: 480px) and (min-device-width: 480px), screen and (device-height: 480px) and (device-width: 320px) and (width: 480px) and (max-height: 320px) {
body { background: #448; }
h3:after { content: 'More than 480px. Possibly a landscape phone or a small tablet.';}
}
/* portrait tablet */
@media screen and (min-width: 768px) {
body { background: #484; }
h3:after { content: 'More than 768px. Looks like a portrait iPad or big tablet.';}
}
/* big screens:
some people like to do this:
@media screen and (min-width: 992px)
this expression now target a portrait ipad too. if that's a problem, we need a new media query to target normal 992px
screens and landscape ipad but excluding ipad's wrongly reported width:1024px after the hack.
the expression is similar to the one used in (min-width:480px); we just adapted the values to target ipad.
*/
@media screen and (min-width: 992px) and (min-device-width: 992px), screen and (device-height: 1024px) and (device-width: 768px) and (width: 1024px) and (max-height: 768px) {
body { background: #844; }
h3:after { content: 'More than 992px. Desktops and landscape tablets.';}
}
/* landscape ipad (exactly):
usually people do this:
@media screen and (min-width: 1024px)
the new expression below is similar to the landscape iphone above; we just changed the values to target ipad.
see the explanation above
*/
@media screen and (min-width: 1024px) and (min-device-width: 1024px), screen and (device-height: 1024px) and (device-width: 768px) and (width: 1024px) and (max-height: 768px) {
body { background: #884; }
h3:after { content: 'More than 1024px. Specifically a landscape iPad, but also other big screens.';}
}
/* really big screens */
@media screen and (min-width: 1200px) {
body { background: #488; }
h3:after { content: 'More than 1200px. Huge screens, like a full screen Desktop browser!';}
}
/*******************************************/
/* Simple CSS to showcase the project demo */
/* (nothing interesting here) */
/*******************************************/
body {
font-size: 10px;
font-family: Arial;
padding: 0;
margin: 0;
}
div, strong, em, h2, li {
margin: 0;
padding: 0;
font-weight: normal;
font-style: normal;
}
hgroup, ul, section {
margin: 20px auto;
width: 90%;
}
hgroup {
margin-left: 20px;
}
h1, h2 {
color: #eef;
font: 32px Tahoma;
margin: 0;
text-shadow: 1px 1px #333;
}
h2 {
color: #dde;
font-size: 24px;
margin-left: 30px;
}
h3 {
background: white;
display: inline-block;
font-weight: normal;
margin: 10px auto;
padding: 10px;
width: auto;
}
p {
color: #cce;
font-size: 1.5em;
margin: 0 0 20px 0;
width: 90%;
}
ul {
width: 80%;
}
li {
font-size: 1.8em;
}
a {
color: #ccf;
}