Complete the code to create a breakpoint for screens wider than 600px.
@media (min-width: [1]) {
body {
background-color: lightblue;
}
}The min-width media feature sets a breakpoint for screens wider than the given width. Here, 600px means styles inside apply when the screen is at least 600 pixels wide.
Complete the code to apply styles only on screens smaller than 768px.
@media ([1]: 768px) { p { font-size: 1.2rem; } }
The max-width media feature targets screens up to the specified width. Here, styles apply only when the screen is 768 pixels wide or less.
Fix the error in the breakpoint code to target screens between 480px and 1024px.
@media (min-width: 480px) and ([1]: 1024px) { div { padding: 2rem; } }
To target screens between two widths, use min-width for the lower limit and max-width for the upper limit. Here, 1024px is the max-width.
Fill both blanks to create a breakpoint for screens between 320px and 480px wide.
@media ([1]: 320px) and ([2]: 480px) { h1 { color: green; } }
Use min-width for the lower limit and max-width for the upper limit to target screen widths between 320px and 480px.
Fill all three blanks to create a responsive font size that changes at three breakpoints: 480px, 768px, and 1024px.
body {
font-size: 1rem;
}
@media ([1]: 480px) {
body {
font-size: 1.2rem;
}
}
@media ([2]: 768px) {
body {
font-size: 1.5rem;
}
}
@media ([3]: 1024px) {
body {
font-size: 1.8rem;
}
}Using min-width for all breakpoints applies styles as the screen gets wider, increasing font size at each breakpoint.