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 trial
Derrick Plunk
Courses Plus Student 2,710 PointsMedia Query Not Functioning Properly
I'm having a problem with my media query not correctly changing an li element. I double checked I formatted the media query correctly and I am able to change the background color of the wrapper and another element on the page, but the wrapper doesn't have a background by default. What I am trying to accomplish is to change the li background from white to a different color when the screen is above 480px.
Here is the HTML:
<div id="wrapper" class="clearfix">
<ul id="divisions">
<li>
<a href="audio-video.html"><img src="img/av_icon.png" alt="Audio-Video">
<p>Audio-Video</p>
</a>
</li>
Here is the CSS:
#divisions {
margin:0;
padding:0;
list-style:none;
}
#divisions li {
text-align:center;
float:left;
width:37.5%;
margin: 2.5%;
padding:2.5%;
background-color:#fff;
border-radius:4px;
}
And the media query:
@media screen and (min-width: 480px) {
#divisons li {
background-color:#c6c6c6;
}
3 Answers
Jeff Busch
19,287 PointsHi Derrick,
I've been looking at your stupid problem for an hour. Sorry, I meant I'm stupid. Look at the spelling of divisons in the media query.
Jeff
Juan Perez
Courses Plus Student 8,944 PointsOn your media query a closing bracket is missing.
@media screen and (min-width: 480px) {
#divisions li { background-color:#c6c6c6; }
}
this is how it should go.
Hope this helps you.
Juan Perez
Courses Plus Student 8,944 PointsLol, that too As Jeff Busch pointed out!
Derrick Plunk
Courses Plus Student 2,710 PointsThank you for both for the help! Jeff, no problem calling it a "stupid" problem was much nicer than the words I was calling it when trying to figure out what was going on!
Juan Perez
Courses Plus Student 8,944 PointsJuan Perez
Courses Plus Student 8,944 PointsGood spotting