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

stjarnan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
stjarnan
Front End Web Development Techdegree Graduate 56,488 Points

Can't get media queries to work

Hi there, so - it appears i am having some huge problems getting media queries to work. Feels like i have been looking for a solution on google for hours but to no avail, so i figured i would come here to ask for help.

/*======================== Media Queries ===================*/ 


@media screen and (max-width: 1200px) {
    .wrapper {
       background-color: beige;
    }
}

@media screen and (max-width: 768px) {
    .wrapper {
        background-color: rgba(255, 44, 44, 0.9);
    }
}

@media screen and (max-width: 300px) {
    .wrapper {
        background-color: rgba(49, 199, 241, 0.9);
    }
}

So that's my code, anyone able to find my error? Feel so stupid right now!

Thanks in advance

Neil Anuskiewicz
Neil Anuskiewicz
11,007 Points

I think it would be helpful to show the HTML code as well as this CSS, at least to me but I'm not an expert, looks fine, so I'm thinking it might be helpful for those trying to help to see the HTML as well.

2 Answers

Alexander Efremov
Alexander Efremov
15,409 Points

Hi! I checked your code - it works well. Check your html file - do you have a class called wrapper?

Isn't it supposed to be min-width?