mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-16 21:06:35 +08:00
feat(curriculum): adding content for css absolute and review units review page (#57035)
This commit is contained in:
parent
dd7906d256
commit
a0473b75aa
@ -1950,7 +1950,8 @@
|
||||
"review-css-relative-and-absolute-units": {
|
||||
"title": "CSS Relative and Absolute Units Review",
|
||||
"intro": [
|
||||
"Review the CSS Relative and Absolute Units concepts to prepare for the upcoming quiz."
|
||||
"Before you are quizzed on relative and absolute units, you first need to review.",
|
||||
"Open up this page to review concepts like percentages, <code>px</code>, <code>rem</code>, <code>em</code>, and more."
|
||||
]
|
||||
},
|
||||
"quiz-css-relative-and-absolute-units": {
|
||||
|
||||
@ -9,7 +9,27 @@ dashedName: review-css-relative-and-absolute-units
|
||||
|
||||
Review the concepts below to prepare for the upcoming quiz.
|
||||
|
||||
## Absolute Units
|
||||
|
||||
- **`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.
|
||||
- **`in` (Inch)**: This absolute unit is equal to 96px.
|
||||
- **`cm` (Centimeters)**: This absolute unit is equal to 25.2/64 of an inch.
|
||||
- **`mm` (Millimeters)**: This absolute unit is equal to 1/10th of a centimeter.
|
||||
- **`q` (Quarter-Millimeters)**: This absolute unit is equal to 1/40th of a centimeter.
|
||||
- **`pc` (Picas)**: This absolute unit is equal to 1/6th of an inch.
|
||||
- **`pt` (Points)**: This absolute unit is equal to 1/72th of an inch.
|
||||
|
||||
## Relative Units
|
||||
|
||||
- **Percentages**: These relative units allow you to define sizes, dimensions, and other properties as a proportion of their parent element. For example, if you set `width: 50%;` on an element, it will occupy half the width of its parent container.
|
||||
- **`em` Unit**: These units are relative to the font size of the element. If you are using `ems` for the `font-size` property, the size of the text will be relative to the font size of the parent element.
|
||||
- **`rem` Unit**: These units are relative to the font size of the root element, which is the `html` element.
|
||||
- **`vh` Unit**: `vh` stands for `"viewport height"` and `1vh` is equal to 1% of the viewport's height.
|
||||
- **`vw` Unit**: `vw` stands for `"viewport width"` and `1vw` is equal to 1% of the viewport's width.
|
||||
|
||||
## `calc` Function
|
||||
|
||||
- **`calc()` Function**: With the `calc()` function, you can perform calculations directly within your stylesheets to determine property values dynamically. This means that you can create flexible and responsive user interfaces by calculating dimensions based on the viewport size or other elements.
|
||||
|
||||
# --assignment--
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user