The correct syntax uses and to combine conditions that must both be true. Option C applies styles only when the screen width is between 600px and 900px.
Option C has the min and max reversed, so it never matches. Option C uses a comma which means 'or', so it applies styles outside the range too. Option C uses 'or' which applies styles if either condition is true, not both.
@media screen min-width: 500px) { body { background: blue; } }@media screen min-width: 500px) { body { background: blue; } }
Media queries require conditions to be inside parentheses. The correct syntax is @media screen and (min-width: 500px). Here, the opening parenthesis before min-width is missing, causing a syntax error.
.box { background: yellow; }
@media (max-width: 600px) { .box { background: red; } }
@media (min-width: 601px) and (max-width: 800px) { .box { background: green; } }
@media (min-width: 801px) { .box { background: blue; } }.box { background: yellow; } @media (max-width: 600px) { .box { background: red; } } @media (min-width: 601px) and (max-width: 800px) { .box { background: green; } } @media (min-width: 801px) { .box { background: blue; } }
The base background is yellow. The first media query applies red only up to 600px. The second media query applies green between 601px and 800px, which includes 700px. The last applies blue above 800px. So at 700px, the background is green.
Option A correctly uses and to require both portrait orientation and minimum width greater than 480px.
Options A and C use commas or 'or', which apply styles if either condition is true, not both. Option A mixes 'and' and 'or' without parentheses, causing unexpected behavior.
Option D is best because visually hiding content (e.g., with clip-path or position: absolute; left: -9999px;) keeps it in the accessibility tree for screen readers.
Option D removes content from the DOM, which can confuse users. Option D hides content from both visual and screen readers, which may remove important information. Option D hides content visually but visibility: hidden also hides it from screen readers.