Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSantiago Lopez
3,446 PointsMedia Colors How many
Can you add more than one media so the background color changes more than 1 time?
1 Answer
Damien Watson
27,419 PointsHi, sure. As you can choose what widths to apply to, maximum size and/or minimum size, you can get quite specific if required. An over the top example may be something like:
body { background-color:#006; }
@media only screen and (min-width: 900px) and (max-width: 1200px) {
body { background-color:#06F; }
}
@media only screen and (min-width: 600px) and (max-width: 900px) {
body { background-color:#090; }
}
@media only screen and (min-width: 300px) and (max-width: 600px) {
body { background-color:#F60; }
}
@media only screen and (max-width: 300px) {
body { background-color:#F60; }
}