Media Query Application
Predict Output Easy
Question
On a 500px wide screen, what is the font size?
Code
p { font-size: 14px; }
@media (min-width: 768px) {
p { font-size: 16px; }
}
Hint
500px is less than 768px, so the media query does not apply.
Explanation
The base style sets font-size: 14px. The media query (min-width: 768px) only applies when the viewport is at least 768px wide. At 500px, the media query does not match, so the font size remains 14px. This is the mobile-first pattern: small screens get base styles, larger screens get overrides.
Related Resources
Related Lessons
- Responsive Design
Learn responsive design.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.