mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-22 21:08:12 +08:00
fix(curriculum): add missing margin & padding shorthand explanations (#60036)
This commit is contained in:
parent
ae6783decc
commit
678dc4334e
@ -127,8 +127,8 @@ ul ~ p {
|
||||
|
||||
- **`margin` Property**: This property is used to apply space outside the element, between the element's border and the surrounding elements.
|
||||
- **`padding` Property**: This property is used to apply space inside the element, between the content and its border.
|
||||
- **`margin` Shorthand**: The `margin` property can be set using the shorthand syntax, which allows you to set the margin for all four sides of an element at once. The values are applied in the order `top`, `right`, `bottom`, `left`.
|
||||
- **`padding` Shorthand**: The `padding` property can also be set using the shorthand syntax, which allows you to set the padding for all four sides of an element at once. The values are applied in the order `top`, `right`, `bottom`, `left`.
|
||||
- **`margin` Shorthand**: You can specify 1–4 values to set the margin sides. One value applies to all four sides; two values set `top` and `bottom`, then `right` and `left`; three values set `top`, horizontal (`right` and `left`), then `bottom`; four values set `top`, `right`, `bottom`, `left`.
|
||||
- **`padding` Shorthand**: You can specify 1–4 values to set the padding sides. One value applies to all four sides; two values set `top` and `bottom`, then `right` and `left`; three values set `top`, horizontal (`right` and `left`), then `bottom`; four values set `top`, `right`, `bottom`, `left`.
|
||||
|
||||
## CSS Specificity
|
||||
|
||||
|
||||
@ -48,7 +48,9 @@ Review the concepts below to prepare for the upcoming exam.
|
||||
## Margin and Padding
|
||||
|
||||
- **`margin` Property**: This property is used to apply space outside the element, between the element's border and the surrounding elements.
|
||||
- **`margin` Shorthand**: You can specify 1–4 values to set the margin sides. One value applies to all four sides; two values set `top` and `bottom`, then `right` and `left`; three values set `top`, horizontal (`right` and `left`), then `bottom`; four values set `top`, `right`, `bottom`, `left`.
|
||||
- **`padding` Property**: This property is used to apply space inside the element, between the content and its border.
|
||||
- **`padding` Shorthand**: You can specify 1–4 values to set the padding sides. One value applies to all four sides; two values set `top` and `bottom`, then `right` and `left`; three values set `top`, horizontal (`right` and `left`), then `bottom`; four values set `top`, `right`, `bottom`, `left`.
|
||||
|
||||
## CSS Specificity
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user