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

My media queries wont work please help me

http://w.trhou.se/crlzlj1ssx please guide me what im doing wrong

2 Answers

Cooper Runstein
Cooper Runstein
11,850 Points

I think you have an extra bracket at the bottom of the page, but you definitely have working media queries, There are a few issues I see:

  1. You should indent and space your CSS consistently across the entire page. This:
.class{color:red padding:1px;
margin: 3px:}

Is much harder to read than:

.class{
    color: red 
    padding: 1px;
    margin: 3px:
}

It's also much easier to see the missing semi-colon in the second one.

  1. Your media queries are repetitive, any screen that is greater than 1051px is also greater than 750px, so the 750px rules still apply. There's no need to apply 90% width to .wrapper at the 1051px query if you've already applied that rule to the 750px query, in fact the only rule that does anything in your 1051px query is the max-width rule.

I hope that is at least a little helpful, I'm not positive what you want each query to do, so I can't help you unless I knw what you want to do. Remove the bracket, change to px, and add a background-color to banner to confirm the query is working even if it's not acting as you want it to. I suspect you may have an extra character in a rule that I missed in due to the formatting. Good luck!

I was just checking that why isnt the queries workIng thats why i was different properties. Im supposed to change then width of the primary secondary and tertiary coontainers

i am really thankful for your detailed answer. but i tried a simpler media query and its still not working... https://w.trhou.se/7iboskhamm heres a new snapshot

Cooper Runstein
Cooper Runstein
11,850 Points

Your media query isn't in valid units, you have 'x' as your unit instead of 'px'

Its not working even after the px