Repository navigation
Expand file tree
/
Copy pathstyles.css
More file actions
618 lines (537 loc) · 12.8 KB
/
Copy pathstyles.css
File metadata and controls
618 lines (537 loc) · 12.8 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
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
/*#text {
/* color: blue; /* Màu xanh cho text */
/* font-size: 24px; /* Kích thước font */
/* font-weight: bold; /* In đậm */
/* text-align: center; /* Căn giữa */
/* margin-top: 50px; /* Khoảng cách từ trên */
/* div {
width: 50mm;
height: 5cm;
} */
/* #box1, #box2, #box3 {
width: 30%;
height: 64px;
margin: 10px;
display: inline-block;
} */
/* Write CSS code here */
/*div {
border: 4px solid red;
}
div {
border-width: 4px;
border-style: solid;
border-color: red;
} */
/*div, p {
border-top-style:
border-right-style:
border-left-style:
border-bottom-style:
border-top-color:
border-right-color:
border-left-color:
border-bottom-color:
border-top-width:
border-right-width:
border-left-width:
border-bottom-width:
padding-top:
paddind-right:
padding-left:
padding-bottom:
} */
/*.container {
border-left-style:
border-left-color:
border-left-width:
}
.container {
border-left: 5px solid blue;
} */
/*<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div>
<p>
I love CSS!
</p>
</div>
</body>
</html> */
/*div {
background-color: #333;
margin: 16px;
}
p {
color: white;
} */
/*div {
box-sizing: border-box;
} */
/*div {
box-shadow:10px 10px 8px 2px cyan; #horizontal-offset vertical-offset blur-radius spread-radius color;
} */
/* div {
border-radius: số px;
border-radius: 10px 10px 8px 2px; #top-left top-right bottom-right bottom-left;
/* color: rgb(255, 0, 0);
color: #ff0000;
color: hsl(0, 100%, 50%);
color: rgba(255, 0, 0, 0.5);
color: hsla(0, 100%, 50%, 0.5);
*/
/* div {
text-align: center; #ngoài ra còn có: left, right, justify;
*/
/* div {
text-decoration: underline; #ngoài ra còn có: overline, line-through, none;
text-decoration: giá trị của text-decoration + color + giá trị của border-style;
text-decoration: giá trị của text-decoration + giá trị của border-style + color;
*/
/* div {
text-shadow: horizontal-offset vertical-offset blur-radius color;
*/
/* .text {
font-family: Arial, Helvetica, sans-serif;
font-family: 'Times New Roman', Times, serif;
font-family: 'Courier New', Courier, monospace;
font-family: 'Lucida Console', 'Courier New', monospace;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
*/
/* div is vertical layout by default and the most straight forward missing feature is placing content in a horizontal layout.
*/
/* div {
display: block;
display: inline;
display: inline-block;
display: flex;
display: grid;
display: none;
display: table;
display: table-cell;
display: table-row;
display: table-column;
display: table-column-group;
display: table-row-group;
display: table-header-group;
display: table-footer-group;
display: table-caption;
display: contents;
display: list-item;
display: initial;
display: inherit;
display: sticky;
*/
/* div {
flex-direction: row; #ngoài ra còn có row-reverse, column, column-reverse
} */
/* div {
justify-content: center; #ngoài ra còn có: flex-start, flex-end, space-between, space-around, space-evenly
} */
/* .container {
align-items:center; #ngoài ra còn có flex-start, flex-end, space-between, space-around, space-evenly, stretch
} */
/* Tổng kết
div {
display: flex;
align-items: center;
justify-content: center;
} */
/*Bài tập bonus
#b1 {
height: 80px;
}
#b4 {
width: 40px;
} */
/* <!--css the object-fit property-->
<!DOCTYPE html>
<html>
<head>
<style>
img {
width:200px;
height: 300px;
}
</style>
</head>
<body>
<h2> Image </h2>
<img src="paris.jpg" alt="Paris" width="400" height="300">
</body>
</html> */
/* Using object-fit cover; # object-fit có các giá trị là fill, contain, cover, none, scale-down
<!DOCTYPE html>
<html>
<head>
<style>
img {
width: 200px;
height: 300px;
object-fit: cover;
}
</style>
</head>
<body>
<h2> Using object-fit:</h2>
<img src="paris.jpg" alt="Paris" width="400" height="300">
</body>
</html> */
/* Using object-fit contain; # object-fit có các giá trị là fill, contain, cover, none, scale-down
<!DOCTYPE html>
<html>
<head>
<style>
img {
width: 200px;
height: 300px;
object-fit: contain;
}
</style>
</head>
<body>
<h2> Using object-fit:contain;</h2>
<img src="paris.jpg" alt="Paris" width="400" height="300">
</body>
</html> */
/* Using object-fit none; # object-fit có các giá trị là fill, contain, cover, none, scale-down
<DOCTYPE html>
<html>
<head>
<style>
img {
width:
height:
object-fit: fill;
}
</style>
</head>
<body>
<h2> Using object-fit:fill;</h2>
<img src="paris.jpg" alt="Paris" width: 400px; height: 300px;
}
</body>
</html> */
/* Using object-fit none; # object-fit có các giá trị là fill, contain, cover, none, scale-down
<!DOCTYPE html>
<html>
<head>
<style>
img {
img {
width:
height:
object-fit: none;
}
</style>
</head>
<body>
<h2> Using object-fit:fill;</h2>
<img src="paris.jpg" alt="Paris" width: 400px; height: 300px;
}
</body>
</html> */
/* Using object-fit scale-down; # object-fit có các giá trị là fill, contain, cover, none, scale-down
<!DOCTYPE html>
<html>
<head>
<style>
img {
width: 300px;
height: 200px;
object-fit: scale-down;
}
</style>
</head>
<body>
<h2> Using object-fit:scale-down;</h2>
<img src="paris.jpg" alt="Paris" width="400" height="300">
</body>
</html> */
/* Another example
<!DOCTYPE html>
<html>
<body>
<h1> Not using obeject-fit</h2>
<p> ...... </p>
<div style="width: 200px; height: 300px;>
<img src="rock600*400.jpg" alt="Norway" style="float: left, width: 50%, height: 100%;">
<img src="paris.jpg" alt="Paris" style="float: left; width: 50%; height: 100%;">
</div>
</body>
</html> */
/* Another example 2
<!DOCTYPE html>
<html>
<body>
<h1> Not using obeject-fit</h2>
<p> ...... </p>
<div style="width: 200px; height: 300px;>
<img src="rock600*400.jpg" alt="Norway" style="float: left, width: 50%, height: 100%;object-fit: cover;">
<img src="paris.jpg" alt="Paris" style="float: left; width: 50%; height: 100%;object-fit: cover;">
</div>
</body>
</html> */
/* More Examples
<!DOCTYPE html>
<html>
<head>
<style>
.fill{object-fit: fill;}
.contain{object-fit: contain;}
.cover{object-fit: cover;}
.scale-down{object-fit: scale-down;}
.none{object-fit: none;}
</style>
</head>
<body>
<h1> ...........</h1>
<h2> ...........</h2>
<img src="paris.jpg" alt="Paris" style=" width="400px" height="300px">
<h2> ...... </h2>
<img class="fill" src="paris.jpg" alt="Paris" style=" width="400px" height="300px">
<h2> ...... </h2>
<img class="contain" src="paris.jpg" alt="Paris" style=" width="400px" height="300px">
<h2> ...... </h2>
<img class="cover" src="paris.jpg" alt="Paris" style=" width="400px" height="300px">
<h2> ...... </h2>
<img class="scale-down" src="paris.jpg" alt="Paris" style=" width="400px" height="300px">
<h2> ...... </h2>
<img class="none" src="paris.jpg" alt="Paris" style=" width="400px" height="300px">
</body>
</html> */
/* CSS The object-position property # cú pháp object-position: x y; #với x là số % hoặc px, y là số % hoặc px
<!DOCTYPE html>
<html>
<head>
<style>
img {
width: 300px;
height: 300px;
object-fit: cover;
object-position: 80% 100%;
}
</style>
</head>
<body>
<h2> Using object-position: 80% 100%;</h2>
<p> ............ </p>
<img src="paris.jpg" alt="Paris" style="width: 300px; height: 300px;>
</body>
</html> */
/* Example
<!DOCTYPE html>
<html>
<head>
<style>
img {
width: 200px;
height: 300px;
object-fit: cover;
object-position: 15%, 100%;
}
</style>
</head>
<body>
<p> ...... </p>
<h2> ...... </h2>
<img src="paris.jpg" alt="Paris" width: "200"; height: "300";>
</body>
</html> */
/* CSS Masking
/* CSS mask-image Property
/* Use an Image as the Mask Layer
/* Example:
<!DOCTYPE html>
<html>
<head>
<style>
.mask1 {
mask-image: url(w3logo.png);
maske-image: url(w3logo.png);
maske-repeat: no-repeat;
}
</style>
</head>
<body>
<h1> .............</h1>
<div class="mask1">
<img src="img.Sterre.jpg" alt="Sterre" width="600" height="400">
</div>
<h3> ...... </h3>
<img src="img.Sterre.jpg" alt="Sterre" width="600" height="400">
</body>
</html> */
/* Another example
<!DOCTYPE html>
<head>
<style>
.mask1 {
maske-image: url(w3logo.png);
maske-image: url(w3logo.png);
}
</style>
</head>
<body>
<h1> .............</h1>
<div class="mask1">
<img src="img.Sterre.jpg" alt="Sterre" width="600" height="400">
</div>
<h3> ...... </h3>
<img src="img.Sterre.jpg" alt="Sterre" width="600" height="400">
</body>
</html> */
/* Use Gradient as the Mask Layer
Linear Gradient:
<!DOCTYPE html>
<html>
<head>
<style>
.mask1 {
maske-image: linear-gradient(transparent, black);
mask-image: linear-gradient(transparent, black);
}
</style>
</head>
<body>
<h1> .............</h1>
<h3> ...... </h3>
<div class="mask1">
<img src="img.Sterre.jpg" alt="Sterre" width="600" height="400">
</div>
<h3> ...... </h3>
<img src="img.Sterre.jpg" alt="Sterre" width="600" height="400">
</body>
</html> */
/* Another Example
<head>
<style>
p {
font-size: 20px;
padding: 20px;
color: white;
}
.mask1 {
max-width: 600px;
height: 350px;
overflow-y: scroll;
background: url(img_5terre.jpg) no-repeat;
-webkit-mask-image: linear-gradient(black, transparent);
mask-image: linear-gradient (black, transparent);
}
</style>
</head>
<body>
<h1>The mask-image Property</h1>
<h3>A linear gradient as a mask layer:</h3>
<div class="mask1">
<p>The Cinque Terre is a coastal area within Liguria, in the northwest of Italy. It lies in the west of La Spezia Province, and comprises five villages: Monterosso al Mare, Vernazza, Corniglia, Manarola, and Riomaggiore.</p>
<p>The Cinque Terre is a coastal area within Liguria, in the northwest of Italy. It lies in the west of La Spezia Province, and comprises five villages: Monterosso al Mare, Vernazza, Corniglia, Manarola, and Riomaggiore.</p>
<p>The Cinque Terre is a coastal area within Liguria, in the northwest of Italy. It lies in the west of La Spezia Province, and comprises five villages: Monterosso al Mare, Vernazza, Corniglia, Manarola, and Riomaggiore.</p>
</div>
</body> */
/* Another Example
<!DOCTYPE html>
<html>
<head>
<style>
.mask2 {
-webkit-mask-image: radial-gradient(circle, black 50%, rgba(0, 0, 0, 0.5) 50%);
mask-image: radial-gradient(circle, black 50%, rgba(0, 0, 0, 0.5) 50%);
}
</style>
</head>
<body>
<h1>The mask-image Property</h1>
<h3>A radial gradient as a mask layer (a circle):</h3>
<div class="mask2">
<img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400">
</div>
<h3>Original image:</h3>
<img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400">
</body>
</html> */
/* Another example
<!DOCTYPE html>
<html>
<head>
<style>
.mask3 {
-webkit-mask-image: radial-gradient(ellipse, black 50%, rgba(0, 0, 0, 0.5) 50%);
mask-image: radial-gradient(ellipse, black 50%, rgba(0, 0, 0, 0.5) 50%);
}
</style>
</head>
<body>
<h1>The mask-image Property</h1>
<h3>A radial gradient as a mask layer (an ellipse):</h3>
<div class="mask3">
<img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400">
</div>
<h3>Original image:</h3>
<img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400">
</body>
</html> */
/* Another example
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>The mask-image Property</h1>
<h3>An SVG mask layer (formed as a triangle):</h3>
<svg width="600" height="400">
<mask id="svgmask1">
<polygon fill="#ffffff" points="200 0, 400 400, 0 400"></polygon>
</mask>
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="img_5terre.jpg" mask="url(#svgmask1)"></image>
</svg>
<h3>Original image:</h3>
<img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400">
</body>
</html> */
/* Another example
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>The mask-image Property</h1>
<h3>An SVG mask layer (formed as a star):</h3>
<svg width="600" height="400">
<mask id="svgmask2">
<polygon fill="#ffffff" points="100,10 40,198 190,78 10,78 160,198"></polygon>
</mask>
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="img_5terre.jpg" mask="url(#svgmask2)"></image>
</svg>
<h3>Original image:</h3>
<img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400">
</body>
</html> */
/* Another example
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>The mask-image Property</h1>
<h3>An SVG mask layer (formed as circles):</h3>
<svg width="600" height="400">
<mask id="svgmask3">
<circle fill="#ffffff" cx="75" cy="75" r="75"></circle>
<circle fill="#ffffff" cx="80" cy="260" r="75"></circle>
<circle fill="#ffffff" cx="270" cy="160" r="75"></circle>
</mask>
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="img_5terre.jpg" mask="url(#svgmask3)"></image>
</svg>
<h3>Original image:</h3>
<img src="img_5terre.jpg" alt="Cinque Terre" width="600" height="400">
</body>
</html> */
/*