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

Media Queries UPDATE

I'm encountering confusing behaviour in my media query.

/* Extra small devices (phones, less than 768px) */
  @media (min-width: 480px) {
    .jumbotron{
      text-align: center;
      i,span{
        float: none;
      }
      img{
        display: inline-block;
        margin-top: 15px;
        margin-bottom: 15px;
      }
      .showcase{
        h1{
          font-size: 40px;
          width: 150%;
          margin-bottom: 35px;
        }
      }
    }
  }

These are the styles I want to apply for mobile devices, however they aren't working. They do however work when I use the !important rule after each style. This obviously defeats the purpose of a media query because these rules will be set at all screen sizes. Why do these styles only work with the !important rule?

I can post more of my code if need be.

1 Answer

Steven Parker
Steven Parker
243,658 Points

:point_right: Bootstrap has a significant number of media queries built-in.

It has a lot of other CSS as well. Are you sure your code doesn't conflict with anything Bootstrap is doing?

You'll probably need to spend some time with the browser developer's tools to see exactly what's affecting or overriding effects on your elements.

I updated my question if you dont mind taking a look.