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

kathryn armitage
kathryn armitage
12,185 Points

What is wrong with this media query???

@media (min-width: 992px) { width: 50%; font-size: 1.3rem; }

This is from a personal project but the media query was written by bootstrap but its showing red marks underneath? I cannot fix it and don't know what the problem is.

Thanks!!

1 Answer

Jamie Reardon
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jamie Reardon
Treehouse Project Reviewer

In this media query you haven't defined the CSS selector you are trying to target, you have only specified the CSS properties that you want to make changes to as styles. Now you need to pick which element you want to style for example (with a class selector):

@media (min-width: 992px) {
  .class-you-want-to-style {
    width: 50%;
    font-size: 1.3rem; 
  }
}

You have specified the breakpoint in the layout where you want to style a certain part of your design at 992px and defined the styles, now you want to add that element you want to apply those styles to.

kathryn armitage
kathryn armitage
12,185 Points

Thank you. This makes all the sense. I will have to download the original file to see if something has been deleted.