0
0
CSSmarkup~5 mins

Media queries in CSS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a media query in CSS?
A media query is a CSS technique that applies styles only when certain conditions about the device or screen are true, like screen width or orientation.
Click to reveal answer
beginner
How do you write a basic media query for screens smaller than 600px?
Use @media (max-width: 600px) { /* CSS rules here */ } to apply styles only when the screen width is 600 pixels or less.
Click to reveal answer
beginner
What does min-width mean in a media query?
min-width means the styles inside the media query apply only if the screen width is at least the specified value.
Click to reveal answer
intermediate
Why are media queries important for accessibility?
They help make websites easier to use on different devices and screen sizes, improving readability and navigation for everyone.
Click to reveal answer
intermediate
What is the difference between max-width and min-width in media queries?
max-width applies styles up to a certain screen width, while min-width applies styles from that width and above.
Click to reveal answer
Which media query applies styles only on screens wider than 800px?
A@media screen and (max-width: 800px)
B@media (max-width: 800px)
C@media (min-width: 800px)
D@media (width: 800px)
What does this media query do? @media (max-width: 500px) { ... }
AApplies styles only if screen width is more than 500px
BApplies styles on all devices
CApplies styles only on devices with exactly 500px width
DApplies styles only if screen width is 500px or less
Which media feature is used to detect device orientation?
Aorientation
Baspect-ratio
Cresolution
Dcolor
How can you combine multiple conditions in a media query?
AUsing <code>or</code> keyword
BUsing <code>and</code> keyword
CUsing <code>but</code> keyword
DUsing <code>then</code> keyword
Which of these is a valid media query for print devices?
A@media print { ... }
B@media screen { ... }
C@media handheld { ... }
D@media all { ... }
Explain how media queries help make a website responsive.
Think about how websites look different on phones and computers.
You got /3 concepts.
    Describe the difference between using min-width and max-width in media queries.
    Consider small screens versus large screens.
    You got /3 concepts.