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 trialNarayana MVL
3,993 PointsBreakpoint
When i taking the task
Create a breakpoint for devices 480 pixels wide or larger. Inside the breakpoint, set the body background to the color navy.
The written the code on the workspace
@media screen and (min-width:480px){ background-color:navy; }
But its Did you change the background color to navy for devices larger than 480px?
where did i go wrong?
2 Answers
Leonardo Hernandez
13,798 Points<style>
@media screen and (min-width:480px) { // These brackets should contain css styles.
// They will be applied if the condition is met
// Select an element within the media query.
}
// Media queries do not work like below ( There is nothing selected either ):
@media screen and (min-width:1280px){ color: white; }
@media screen and (min-width:780px){ color: blue; }
@media screen and (min-width:480px){ color: red; }
</style>
Narayana MVL
3,993 PointsThanks for help Leonardo , I figure out
As I forgot to give selectors in breakpoint
<style>
@media screen and (max-widht: 480px)
{
body{
background:navy;
}
}
</style>
Leonardo Hernandez
13,798 PointsTy, Nice work !
Narayana MVL
3,993 PointsNarayana MVL
3,993 PointsThanks for help Leonardo , I figure out
As I forgot to give selectors in breakpoint