Skip to content

Commit 4df884b

Browse files
Ksound22jdwilkin4
andauthored
feat: added more questions to absolute and relative units quiz (freeCodeCamp#58441)
Co-authored-by: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com>
1 parent 0761369 commit 4df884b

File tree

2 files changed

+58
-58
lines changed

2 files changed

+58
-58
lines changed

curriculum/challenges/english/25-front-end-development/quiz-css-relative-and-absolute-units/66ed9009f45ce3ece4053eb7.md

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ To pass the quiz, you must correctly answer at least 18 of the 20 questions belo
1717

1818
#### --text--
1919

20-
If the body text is `16px`, how much is `1em` in most child elements?
20+
What is an absolute unit?
2121

2222
#### --distractors--
2323

24-
`18px`
24+
Units that adjust dynamically based on screen size.
2525

2626
---
2727

28-
`12px`
28+
Units that depend on the font size of the parent element.
2929

3030
---
3131

32-
It depends on the parent's font size
32+
Units measured in percentages of the viewport.
3333

3434
#### --answer--
3535

36-
`16px`
36+
Fixed length units that are not relative to anything else.
3737

3838
### --question--
3939

@@ -43,41 +43,41 @@ What does `100vw` cover in terms of screen width?
4343

4444
#### --distractors--
4545

46-
100% of the screen width
46+
`100%` of the screen width
4747

4848
---
4949

50-
100% of the viewport height
50+
`100%` of the viewport height
5151

5252
---
5353

54-
100% of the parent's width
54+
`100%` of the parent's width
5555

5656
#### --answer--
5757

58-
100% of the viewport width
58+
`100%` of the viewport width
5959

6060
### --question--
6161

6262
#### --text--
6363

64-
If a container is `1000px` wide, how wide is 5% of it?
64+
Which of the following is a relative unit?
6565

6666
#### --distractors--
6767

68-
`100px`
68+
`pt`
6969

7070
---
7171

72-
`500px`
72+
`cm`
7373

7474
---
7575

76-
`5px`
76+
`mm`
7777

7878
#### --answer--
7979

80-
`50px`
80+
`em`
8181

8282
### --question--
8383

@@ -127,23 +127,23 @@ Add, subtract, multiply, or divide different units
127127

128128
#### --text--
129129

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?
131131

132132
#### --distractors--
133133

134-
`1.33pt`
134+
`inch`
135135

136136
---
137137

138-
`1pt`
138+
`rem`
139139

140140
---
141141

142-
`2pt`
142+
`%`
143143

144144
#### --answer--
145145

146-
`0.75pt`
146+
`px`
147147

148148
### --question--
149149

@@ -215,23 +215,23 @@ It adds `10px` to `20%` of the parent's width.
215215

216216
#### --text--
217217

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?
219219

220220
#### --distractors--
221221

222-
`25px`
222+
`px`
223223

224224
---
225225

226-
`15px`
226+
`pt`
227227

228228
---
229229

230-
`20px`
230+
`%`
231231

232232
#### --answer--
233233

234-
`30px`
234+
`rem`
235235

236236
### --question--
237237

@@ -259,7 +259,7 @@ With a root font size of `16px`, how big is `10rem`?
259259

260260
#### --text--
261261

262-
Why might you use `pt` instead of `px` in design?
262+
Why might you use `point` instead of `pixels` in design?
263263

264264
#### --distractors--
265265

@@ -281,23 +281,23 @@ Points are for print design
281281

282282
#### --text--
283283

284-
How does `calc(10vh + 50px)` work for height?
284+
Why are `rem` units preferred over `pixels` in typography?
285285

286286
#### --distractors--
287287

288-
It adds `50px` to 10% of the viewport width.
288+
Because they provide fixed sizing regardless of screen resolution.
289289

290290
---
291291

292-
It adds `10px` to 50% of the parent's height.
292+
Because they ensure compatibility with older browsers.
293293

294294
---
295295

296-
It adds `10vh` to 50% of the document width.
296+
Because they are easier to implement in responsive designs.
297297

298298
#### --answer--
299299

300-
It adds `50px` to 10% of the viewport height.
300+
Because they scale proportionally with the user’s browser settings.
301301

302302
### --question--
303303

@@ -307,63 +307,63 @@ How much screen space does `80vw` take?
307307

308308
#### --distractors--
309309

310-
80% of the parent's width
310+
`80%` of the parent's width
311311

312312
---
313313

314-
100% of the viewport height
314+
`100%` of the viewport height
315315

316316
---
317317

318318
`80px`
319319

320320
#### --answer--
321321

322-
80% of the viewport width
322+
`80%` of the viewport width
323323

324324
### --question--
325325

326326
#### --text--
327327

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?
329329

330330
#### --distractors--
331331

332-
`24px`
332+
`pt` and `px`
333333

334334
---
335335

336-
`18px`
336+
`rem` and `em`
337337

338338
---
339339

340-
`20px`
340+
`pt` and `pc`
341341

342342
#### --answer--
343343

344-
`36px`
344+
`vw` and `vh`
345345

346346
### --question--
347347

348348
#### --text--
349349

350-
What does `calc(50% + 20px)` do for width?
350+
What does `vw` stand for?
351351

352352
#### --distractors--
353353

354-
It adds `20px` to 50% of the screen width.
354+
Vertical Width.
355355

356356
---
357357

358-
It adds `50px` to the screen width.
358+
Virtual Width.
359359

360360
---
361361

362-
It adds `50%` of the height to `20px`.
362+
Variable Width.
363363

364364
#### --answer--
365365

366-
It adds `50%` of the parent's width to `20px`.
366+
Viewport Width.
367367

368368
### --question--
369369

@@ -373,41 +373,41 @@ What's the key difference between `rem` and `em` in CSS?
373373

374374
#### --distractors--
375375

376-
`rem` is only used for fonts.
376+
`em` is relative to the root element, while rem is relative to the parent element.
377377

378378
---
379379

380-
`rem` is for width, `em` is for fonts.
380+
`rem` is relative to desktop width, while `em` is relative to mobile width.
381381

382382
---
383383

384-
`rem` is always smaller than `em`.
384+
`rem` is relative to the user-defined width, while `em` is relative to the browser width.
385385

386386
#### --answer--
387387

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.
389389

390390
### --question--
391391

392392
#### --text--
393393

394-
How does `calc(100px + 10%)` work for width?
394+
What is a `vh` unit?
395395

396396
#### --distractors--
397397

398-
It adds `10%` of the screen width to `100px`.
398+
A unit based on the width of the viewport.
399399

400400
---
401401

402-
It adds `10%` of the height to `100px`.
402+
A unit based on the height of the element.
403403

404404
---
405405

406-
It adds `100px` to `10%` of the document.
406+
A unit that adjusts based on font size.
407407

408408
#### --answer--
409409

410-
It adds `10%` of the parent's width to `100px`.
410+
A unit equal to 1% of the viewport height.
411411

412412
### --question--
413413

@@ -435,21 +435,21 @@ It allows the browser to determine the width based on the content and container.
435435

436436
#### --text--
437437

438-
What happens when you use `calc(30vh - 10px)` for height?
438+
What’s a key advantage of the `calc()` function?
439439

440440
#### --distractors--
441441

442-
It subtracts `10px` from the parent's height.
442+
It automatically minifies your CSS files for better performance.
443443

444444
---
445445

446-
It subtracts `30px` from the screen height.
446+
It enables the use of variables within CSS without any preprocessors.
447447

448448
---
449449

450-
It adds `30%` of the parent's height minus `10px`.
450+
It allows embedding JavaScript expressions directly within CSS rules.
451451

452452
#### --answer--
453453

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.
455455

curriculum/challenges/english/25-front-end-development/review-css-relative-and-absolute-units/671a8f8350c20a7439015c98.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Review the concepts below to prepare for the upcoming quiz.
1111

1212
## Absolute Units
1313

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.
1515
- **`in` (Inch)**: This absolute unit is equal to 96px.
1616
- **`cm` (Centimeters)**: This absolute unit is equal to 25.2/64 of an inch.
1717
- **`mm` (Millimeters)**: This absolute unit is equal to 1/10th of a centimeter.

0 commit comments

Comments
 (0)