Skip to content

Commit 6c6a0a8

Browse files
lasjorgNaomi Carrigan
and
Naomi Carrigan
authored
fix(curriculum): explain media queries (freeCodeCamp#47389)
* fix(curriculum): explain media queries * Update curriculum/challenges/english/14-responsive-web-design-22/learn-responsive-web-design-by-building-a-piano/612ebcba99bfa46a15370b11.md Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com> Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
1 parent 7b6924b commit 6c6a0a8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

curriculum/challenges/english/14-responsive-web-design-22/learn-responsive-web-design-by-building-a-piano/612ebcba99bfa46a15370b11.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,19 @@ dashedName: step-27
77

88
# --description--
99

10-
Now you need to make it responsive. Add a `@media` query with a `max-width` of `768px`.
10+
The `@media` at-rule, also known as a media query, is used to conditionally apply CSS. Media queries are commonly used to apply CSS based on the viewport width using the `max-width` and `min-width` properties.
11+
12+
In the below example the padding is applied to the `.card` class when the viewport is `960px` wide and below.
13+
14+
```css
15+
@media (max-width: 960px) {
16+
.card {
17+
padding: 2rem;
18+
}
19+
}
20+
```
21+
22+
Add a media query that will be applied when the viewport is `768px` wide and below.
1123

1224
# --hints--
1325

0 commit comments

Comments
 (0)