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

CSS

Media 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

Hi 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

Good spotting

On 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.

Lol, that too As Jeff Busch pointed out!

Thank 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!