treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Why don't these @media query rules get applied?

  • Hi

    Here is an issue with the sidebar on this site:

    http://cashflowrollercoaster.com.

    When the site goes under 960 pixels, I want these rules to apply:

      @media screen and (max-width: 960px) {
             .sb-inner {
          padding: 10px 10px 20px 10px;
          display: block;
          margin: 0 auto;
          text-align: center;
        }
             /* even more rules */
      }
      

    Inspecting in Firebug, I don't see this getting called. Can you help?

  • Is it being overridden by your code for custom widgets on line 1792 of your style sheets?

    It comes after your media queries...perhaps it needs to come higher?

  • throws paulie a css linter

    your @media screen and (min-width: 960px) statement above the max-width one hasn't been closed out properly with a }

  • I found the problem.

    I ran the CSS through a validator. There was an error above this code which prevented it from being processed.

    All fixed!

  • ToxicFire - you are exactly right - thank you.