You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: curriculum/challenges/english/25-front-end-development/quiz-css-relative-and-absolute-units/66ed9009f45ce3ece4053eb7.md
+57-57Lines changed: 57 additions & 57 deletions
Original file line number
Diff line number
Diff line change
@@ -17,23 +17,23 @@ To pass the quiz, you must correctly answer at least 18 of the 20 questions belo
17
17
18
18
#### --text--
19
19
20
-
If the body text is `16px`, how much is `1em` in most child elements?
20
+
What is an absolute unit?
21
21
22
22
#### --distractors--
23
23
24
-
`18px`
24
+
Units that adjust dynamically based on screen size.
25
25
26
26
---
27
27
28
-
`12px`
28
+
Units that depend on the font size of the parent element.
29
29
30
30
---
31
31
32
-
It depends on the parent's font size
32
+
Units measured in percentages of the viewport.
33
33
34
34
#### --answer--
35
35
36
-
`16px`
36
+
Fixed length units that are not relative to anything else.
37
37
38
38
### --question--
39
39
@@ -43,41 +43,41 @@ What does `100vw` cover in terms of screen width?
43
43
44
44
#### --distractors--
45
45
46
-
100% of the screen width
46
+
`100%` of the screen width
47
47
48
48
---
49
49
50
-
100% of the viewport height
50
+
`100%` of the viewport height
51
51
52
52
---
53
53
54
-
100% of the parent's width
54
+
`100%` of the parent's width
55
55
56
56
#### --answer--
57
57
58
-
100% of the viewport width
58
+
`100%` of the viewport width
59
59
60
60
### --question--
61
61
62
62
#### --text--
63
63
64
-
If a container is `1000px` wide, how wide is 5% of it?
64
+
Which of the following is a relative unit?
65
65
66
66
#### --distractors--
67
67
68
-
`100px`
68
+
`pt`
69
69
70
70
---
71
71
72
-
`500px`
72
+
`cm`
73
73
74
74
---
75
75
76
-
`5px`
76
+
`mm`
77
77
78
78
#### --answer--
79
79
80
-
`50px`
80
+
`em`
81
81
82
82
### --question--
83
83
@@ -127,23 +127,23 @@ Add, subtract, multiply, or divide different units
127
127
128
128
#### --text--
129
129
130
-
On a typical screen with 96 DPI resolution, how many points (`pt`) are in 1 pixel (`px`)?
130
+
Which unit is the most commonly used absolute unit in CSS?
131
131
132
132
#### --distractors--
133
133
134
-
`1.33pt`
134
+
`inch`
135
135
136
136
---
137
137
138
-
`1pt`
138
+
`rem`
139
139
140
140
---
141
141
142
-
`2pt`
142
+
`%`
143
143
144
144
#### --answer--
145
145
146
-
`0.75pt`
146
+
`px`
147
147
148
148
### --question--
149
149
@@ -215,23 +215,23 @@ It adds `10px` to `20%` of the parent's width.
215
215
216
216
#### --text--
217
217
218
-
If the parent element's text size is `20px`, how big is `1.5em`?
218
+
Which unit is relative to the font size of the root element?
219
219
220
220
#### --distractors--
221
221
222
-
`25px`
222
+
`px`
223
223
224
224
---
225
225
226
-
`15px`
226
+
`pt`
227
227
228
228
---
229
229
230
-
`20px`
230
+
`%`
231
231
232
232
#### --answer--
233
233
234
-
`30px`
234
+
`rem`
235
235
236
236
### --question--
237
237
@@ -259,7 +259,7 @@ With a root font size of `16px`, how big is `10rem`?
259
259
260
260
#### --text--
261
261
262
-
Why might you use `pt` instead of `px` in design?
262
+
Why might you use `point` instead of `pixels` in design?
263
263
264
264
#### --distractors--
265
265
@@ -281,23 +281,23 @@ Points are for print design
281
281
282
282
#### --text--
283
283
284
-
How does `calc(10vh + 50px)` work for height?
284
+
Why are `rem` units preferred over `pixels` in typography?
285
285
286
286
#### --distractors--
287
287
288
-
It adds `50px` to 10% of the viewport width.
288
+
Because they provide fixed sizing regardless of screen resolution.
289
289
290
290
---
291
291
292
-
It adds `10px` to 50% of the parent's height.
292
+
Because they ensure compatibility with older browsers.
293
293
294
294
---
295
295
296
-
It adds `10vh`to 50% of the document width.
296
+
Because they are easier to implement in responsive designs.
297
297
298
298
#### --answer--
299
299
300
-
It adds `50px` to 10% of the viewport height.
300
+
Because they scale proportionally with the user’s browser settings.
301
301
302
302
### --question--
303
303
@@ -307,63 +307,63 @@ How much screen space does `80vw` take?
307
307
308
308
#### --distractors--
309
309
310
-
80% of the parent's width
310
+
`80%` of the parent's width
311
311
312
312
---
313
313
314
-
100% of the viewport height
314
+
`100%` of the viewport height
315
315
316
316
---
317
317
318
318
`80px`
319
319
320
320
#### --answer--
321
321
322
-
80% of the viewport width
322
+
`80%` of the viewport width
323
323
324
324
### --question--
325
325
326
326
#### --text--
327
327
328
-
If the root font size is `18px`, how big is `2rem`?
328
+
Which units should you use if you want to make an element occupy a certain width or height by the percentage of the screen?
329
329
330
330
#### --distractors--
331
331
332
-
`24px`
332
+
`pt` and `px`
333
333
334
334
---
335
335
336
-
`18px`
336
+
`rem` and `em`
337
337
338
338
---
339
339
340
-
`20px`
340
+
`pt` and `pc`
341
341
342
342
#### --answer--
343
343
344
-
`36px`
344
+
`vw` and `vh`
345
345
346
346
### --question--
347
347
348
348
#### --text--
349
349
350
-
What does `calc(50% + 20px)` do for width?
350
+
What does `vw` stand for?
351
351
352
352
#### --distractors--
353
353
354
-
It adds `20px` to 50% of the screen width.
354
+
Vertical Width.
355
355
356
356
---
357
357
358
-
It adds `50px` to the screen width.
358
+
Virtual Width.
359
359
360
360
---
361
361
362
-
It adds `50%` of the height to `20px`.
362
+
Variable Width.
363
363
364
364
#### --answer--
365
365
366
-
It adds `50%` of the parent's width to `20px`.
366
+
Viewport Width.
367
367
368
368
### --question--
369
369
@@ -373,41 +373,41 @@ What's the key difference between `rem` and `em` in CSS?
373
373
374
374
#### --distractors--
375
375
376
-
`rem` is only used for fonts.
376
+
`em` is relative to the root element, while rem is relative to the parent element.
377
377
378
378
---
379
379
380
-
`rem` is for width, `em` is for fonts.
380
+
`rem` is relative to desktop width, while `em` is relative to mobile width.
381
381
382
382
---
383
383
384
-
`rem` is always smaller than `em`.
384
+
`rem` is relative to the user-defined width, while `em` is relative to the browser width.
385
385
386
386
#### --answer--
387
387
388
-
`rem` is based on the root font size, `em`is based on the parent's font size.
388
+
`em` is relative to the font size of the parent element, while rem is relative to the root element.
389
389
390
390
### --question--
391
391
392
392
#### --text--
393
393
394
-
How does `calc(100px + 10%)` work for width?
394
+
What is a `vh` unit?
395
395
396
396
#### --distractors--
397
397
398
-
It adds `10%` of the screen width to `100px`.
398
+
A unit based on the width of the viewport.
399
399
400
400
---
401
401
402
-
It adds `10%` of the height to `100px`.
402
+
A unit based on the height of the element.
403
403
404
404
---
405
405
406
-
It adds `100px` to `10%` of the document.
406
+
A unit that adjusts based on font size.
407
407
408
408
#### --answer--
409
409
410
-
It adds `10%` of the parent's width to `100px`.
410
+
A unit equal to 1% of the viewport height.
411
411
412
412
### --question--
413
413
@@ -435,21 +435,21 @@ It allows the browser to determine the width based on the content and container.
435
435
436
436
#### --text--
437
437
438
-
What happens when you use `calc(30vh - 10px)`for height?
438
+
What’s a key advantage of the `calc()`function?
439
439
440
440
#### --distractors--
441
441
442
-
It subtracts `10px` from the parent's height.
442
+
It automatically minifies your CSS files for better performance.
443
443
444
444
---
445
445
446
-
It subtracts `30px` from the screen height.
446
+
It enables the use of variables within CSS without any preprocessors.
447
447
448
448
---
449
449
450
-
It adds `30%` of the parent's height minus `10px`.
450
+
It allows embedding JavaScript expressions directly within CSS rules.
451
451
452
452
#### --answer--
453
453
454
-
It subtracts `10px` from `30%`of the viewport height.
454
+
It lets you determine the value of a CSS property dynamically based on different aspects of the application or viewport.
Copy file name to clipboardExpand all lines: curriculum/challenges/english/25-front-end-development/review-css-relative-and-absolute-units/671a8f8350c20a7439015c98.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Review the concepts below to prepare for the upcoming quiz.
11
11
12
12
## Absolute Units
13
13
14
-
-**`px` (Pixels)**: This absolute unit is a fixed-size unit of measurement in CSS, providing precise control over dimensions. This means that 1px is always equal to 1/96th of an inch.
14
+
-**`px` (Pixels)**: This absolute unit is a fixed-size unit of measurement in CSS. It is the most common absolute unit and provides precise control over dimensions. `1px` is always equal to 1/96th of an inch.
15
15
-**`in` (Inch)**: This absolute unit is equal to 96px.
16
16
-**`cm` (Centimeters)**: This absolute unit is equal to 25.2/64 of an inch.
17
17
-**`mm` (Millimeters)**: This absolute unit is equal to 1/10th of a centimeter.
0 commit comments