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

Konrad Pilch
Konrad Pilch
2,435 Points

How do i align .pull-left to align center in bootstrap after xxx width?

How do i align .pull-left to align center in bootstrap after xxx width?

1 Answer

As you can see in their documentation, the .pull-left class adds a float: left !important; declaration on the element. There is no pre-defined class that changes that at a certain breakpoint, although the .center-block class does what you want. So, you'd have to write your own rule for this element that will override it at the breakpoint you want. Try:

@media only screen and (min-width: 000px) { /* <---change this "000" to your desired width */
  your-element-selector {
    float: none !important;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
} /* end media query */

Hope that helps!