Home › Forums › CSS › Need help with media queries › Reply To: Need help with media queries
The only reason only the body’s background color is changing is that background-color
is the only style you’re modifying within the media query:
@media only screen and (max-width: 550px) {
body {
background-color: lightblue;
}
}
if you wanted the body’s font size to change too, you would have to put a new rule into the media query, something like:
@media only screen and (max-width: 550px) {
body {
background-color: lightblue;
font-size:20px;
}
}
You can imagine media queries as “if” statements… so for the query you wrote, you can read it as “if the screen size is 550px or less, then apply the following styles”
Also, you might want to check your code for syntax errors… I noticed at least one rogue bracket…