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

stjarnan
Front End Web Development Techdegree Graduate 56,488 PointsCan'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
2 Answers

Alexander Efremov
15,409 PointsHi! I checked your code - it works well. Check your html file - do you have a class called wrapper?

stjarnan
Front End Web Development Techdegree Graduate 56,488 PointsAh, thanks - wrapper was an id, i think i got tunnel vision on that one! Thanks Alexandr for opening my eyes!

Robert Ellefson
5,672 PointsIsn't it supposed to be min-width?
Neil Anuskiewicz
11,007 PointsNeil Anuskiewicz
11,007 PointsI 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.