-
Notifications
You must be signed in to change notification settings - Fork 0
/
styles.css
302 lines (253 loc) · 5.63 KB
/
styles.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
body, h1, h2, a, ul, li{
margin: 0px;
padding: 0px;
font-family: arial;
}
header{
background-color: rgb(253, 20, 4);
border: 1px solid black;
padding: 7px;
/* fixed position go inside the absolute postion on scrolling */
position: fixed;
top:0;
left: 0;
text-align: center;
width: 100%;
/* default z-index is 0 for all the other css property */
z-index: 1;
}
header h1{
color: white;
border: 8px solid white;
/* padding: top-bottom , left-right */
padding: 6px 40px;
/* we use inline-block so that we can take control of the padding and make them inline as well */
display: inline-block;
border-radius:50px;
}
.banner{
position: relative;
}
/* use % -> to make changes dynamic and values to make changes static */
.banner img{
max-width: 100%;
}
/* to change any position in inner tag,the parent tag must have a non static position */
/* in absolute we take that element space out of the document flow and it loses it's space in page that it was previously holding */
.banner .welcome{
position: absolute;
left: 0;
top: 30%;
background-color: #feb614;
color: white;
padding: 30px;
}
.banner h2{
font-size: 35px;
}
.banner h2 span{
/* em is used to multiply value to its parent's respective property */
font-size: 1.3em;
}
nav{
background-color: lightgray;
padding: 10px;
/* sticky will work as fixed until it reaches its side threshold value */
position: sticky;
top: 80px;
width: 100%;
}
nav ul{
/* avoding wrapping to the next line */
white-space: nowrap;
max-width: 1200px;
margin: 0px auto ;
}
nav li{
display: inline-block;
padding: 0 20px;
width: 25%;
font-size: 20px;
box-sizing: border-box;
}
.main-nav a{
text-decoration: none;
}
.main-nav .join{
color: rgb(245, 4, 4);
text-decoration: underline;
}
main{
max-width: 100%;
/* to control position use margin and width */
width: 1200px;
/* top-bottom & left-right */
margin: 70px auto;
padding: 0px 40px;
/* to control the text going out of the page */
box-sizing: border-box;
}
article h2{
font-size: 27px;
}
article p{
/* spacing between the lines */
margin-top: 7px;
line-height: 1.2em;
color: #4b4b4b;
}
.images{
text-align: center;
margin: 80px 0px;
white-space: nowrap;
}
.images li{
display: inline-block;
width: 40%;
margin: 10px 5%;
/* this makes totally 50% width for a single img */
}
.images li img{
max-width: 100%;
/* that makes 100% to its parent thats li which is 40% of its parent */
}
.join-form{
background-color: silver;
text-align: center;
padding: 0px 20px;
padding-top: 11px;
padding-bottom: 0px;
}
.join-form h2{
font-size: 34;
}
.join-form p{
margin: 9px;
margin-top: 0px;
font-size: 15px;
}
form{
margin-bottom: 0px;
}
form input{
margin: 15px 0px;
padding: 7px 21px;
margin-top: 0px;
border: 4px solid white;
border-radius: 36px;
font-size: 15px;
outline: none;
}
form input[placeholder]{
text-align: center;
}
footer p{
border: 1px solid black;
background-color: rgba(19, 83, 56, 0.336);
margin: 0px;
text-align: right;
}
/* pseudo classes */
/* we use : to access pseudo class of the css poperty */
.main-nav a:hover{
text-decoration: underline;
}
.images li:hover{
/* change to absolute then see magic */
position: relative;
/* it means move towards to by 5 px but will work only if the position: relative */
top: -5px;
}
form input:focus{
border: 1px dashed black;
background-color: rgb(247, 10, 10);
}
form input:valid{
border: 4px solid rgb(112, 172, 24);
background-color: rgb(151, 216, 54);
}
/* pseudo elements are like classes to make content dynamic */
article p::first-line{
font-weight: 7px;
font-size: 1.2em;
}
.join-form p::selection{
color: yellow;
background-color: sandybrown;
}
p::after{
content: '.....';
}
/* media query for responsive page design */
/* this has to be either more specific or equally specific else wont be applied */
@media screen and (max-width: 400px){
body, h1, h2, ul, li, a, header{
padding: 0px;
margin: 0px;
font-family: Arial, Helvetica, sans-serif;
}
header h1{
font-size: 27px;
border: 4px solid white;
margin: 5px;
padding: 1px 20px;
}
.banner .welcome{
position: relative;
padding: 2px;
}
.banner h2{
font-size: 20px;
text-align: center;
}
/* to take control over the tag just use display */
.banner h2 br{
display: none;
}
.banner h2 span{
font-size: 1.2em;
}
nav{
padding: 5px;
/* sticky will work as fixed until it reaches its side threshold value */
position: sticky;
top: 50px;
width: 100%;
}
nav li{
display: inline;
padding: 0 2px;
font-size: 15px;
box-sizing: border-box;
}
main{
margin: 21px auto;
padding: 0px 40px;
/* to control the text going out of the page */
box-sizing: border-box;
}
article h2{
font-size: 15px;
}
main article h2{
font-size: 20px;
}
main article p{
font-size: 15px;
}
.images {
text-align: center;
margin: 30px 0px;
white-space: nowrap;
}
.images li{
display: block;
width: 90%;
margin-left: 30%;
margin: 10px 5%;
}
.images li:hover{
position: relative;
left: -5px;
}
}