Skip to content

Commit 0f08396

Browse files
authored
feat(curriculum): adding content to responsive web design review page (freeCodeCamp#57109)
1 parent e71004b commit 0f08396

File tree

2 files changed

+105
-1
lines changed

2 files changed

+105
-1
lines changed

client/i18n/locales/english/intro.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2333,7 +2333,8 @@
23332333
"review-responsive-web-design": {
23342334
"title": "Responsive Web Design Review",
23352335
"intro": [
2336-
"Review the Responsive Web Design concepts to prepare for the upcoming quiz."
2336+
"Before you are quizzed on the fundamentals of responsive design, you first need to review.",
2337+
"Open up this page to review concepts like media queries, media breakpoints and mobile first approach design."
23372338
]
23382339
},
23392340
"quiz-responsive-web-design": {

curriculum/challenges/english/25-front-end-development/review-responsive-web-design/671a98927af7829722697dc2.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,109 @@ dashedName: review-responsive-web-design
99

1010
Review the concepts below to prepare for the upcoming quiz.
1111

12+
## Responsive Web Design
13+
14+
- **Definition**: The core principle of responsive design is adaptability – the ability of a website to adjust its layout and content based on the screen size and capabilities of the device it's being viewed on.
15+
- **Fluid grids**: These use relative units like percentages instead of fixed units like pixels, allowing content to resize and reflow based on screen size.
16+
- **Flexible images**: These are set to resize within their containing elements, ensuring they don't overflow their containers on smaller screens.
17+
18+
## Media Queries
19+
20+
- **Definition**: This allows developers to apply different styles based on the characteristics of the device, primarily the viewport width.
21+
22+
```css
23+
@media screen and (min-width: 768px) {
24+
/* Styles for screens at least 768px wide */
25+
}
26+
```
27+
28+
- **`all` Media Type**: This is suitable for all devices. This is the default if no media type is specified.
29+
- **`print` Media Types**: This is intended for paged material and documents viewed on a screen in print preview mode.
30+
- **`screen` Media Types**: This is intended primarily for screens.
31+
- **`aspect-ratio`**: This describes the ratio between the width and height of the viewport.
32+
33+
```css
34+
@media screen and (aspect-ratio: 16/9) {
35+
/* Styles for screens with a 16:9 aspect ratio */
36+
}
37+
```
38+
39+
- **`orientation`**: This is used to indicate whether the device is in landscape or portrait orientation.
40+
41+
```css
42+
@media screen and (orientation: landscape) {
43+
/* Styles for landscape orientation */
44+
}
45+
```
46+
47+
- **`resolution`**: This is used to describe the resolution of the output device in dots per inch (dpi) or dots per centimeter (dpcm).
48+
49+
```css
50+
@media screen and (min-resolution: 300dpi) {
51+
/* Styles for high-resolution screens */
52+
}
53+
```
54+
55+
- **`hover`**: This is used to test whether the primary input mechanism can hover over elements.
56+
57+
```css
58+
@media (hover: hover) {
59+
/* Styles for devices that support hover */
60+
}
61+
```
62+
63+
- **`prefers-color-scheme`**: This is used to detect if the user has requested a light or dark color theme.
64+
- **Media Queries and Logical Operators**: The `and` operator is used to combine multiple media features, while `not` and `only` can be used to negate or isolate media queries.
65+
66+
```css
67+
@media screen and (min-width: 768px) and (orientation: landscape) {
68+
/* Styles for landscape screens at least 768px wide */
69+
}
70+
```
71+
72+
## Common Media Breakpoints
73+
74+
- **Definition**: Media breakpoints are specific points in a website's design where the layout and content adjust to accommodate different screen sizes. There are some general breakpoints that you can use to target phones, tablets and desktop screens. But it is not wise to try to chase down every single possible screen size for different devices.
75+
76+
```css
77+
/* Styles for screens wider than 768px */
78+
@media screen and (min-width: 768px) {
79+
body {
80+
font-size: 1.125rem;
81+
}
82+
}
83+
```
84+
85+
- **Small Devices (smartphones)**: up to 640px
86+
- **Medium Devices (tablets)**: 641px to 1024px
87+
- **Large Devices (desktops)**: 1025px and larger
88+
89+
## Mobile first approach
90+
91+
- **Definition**: The `mobile-first` approach is a design philosophy and development strategy in responsive web design that prioritizes creating websites for mobile devices before designing for larger screens.
92+
93+
```css
94+
/* Base styles for mobile */
95+
.container {
96+
width: 100%;
97+
padding: 10px;
98+
}
99+
100+
/* Styles for larger screens */
101+
@media screen and (min-width: 768px) {
102+
.container {
103+
width: 750px;
104+
margin: 0 auto;
105+
padding: 20px;
106+
}
107+
}
108+
109+
@media screen and (min-width: 1024px) {
110+
.container {
111+
width: 960px;
112+
}
113+
}
114+
```
12115

13116

14117
# --assignment--

0 commit comments

Comments
 (0)