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

Ruby

bootstrap 3.0 columns

why are there multiple columns in the css. for example there is large and extra small. what is the difference because even when you put in the extra small and make the window large, there arn't any changes. just asking because i might be missing out on somthing

1 Answer

In short: They give you 4 options to control layouts at various screen sizes. Check it out here: http://getbootstrap.com/css/#grid

because even when you put in the extra small and make the window large, there arn't any changes.

That is because the XS column layout only gets applied when the screen is less than 768px. When the screen size between 768px and 991px, the SM column is what is used, when the screen between 992px and 1199px the MD column is applied, and when the screen size is 1200px and greater, the LG column gets applied.

So I could have something like

<div class="row">
    <div class="col-xs-6 col-sm-4 col-md-3 col-lg-2"> {some content} </div>
    <div class="col-xs-6 col-sm-4 col-md-3 col-lg-2"> {some content} </div>
    <div class="col-xs-6 col-sm-4 col-md-3 col-lg-2"> {some content} </div>
    <div class="col-xs-6 col-sm-4 col-md-3 col-lg-2"> {some content} </div>
    <div class="col-xs-6 col-sm-4 col-md-3 col-lg-2"> {some content} </div>
</div>

What is this going to look like? Screen sizes 765px and smaller will have these divs stacked two per row. Screen sizes 768px to 991px will have these elements stacked 3 per row. Screen sizes 992px to 1199px will have these stacked 4 per row, and screen sizes greater than 1200px will have all 5 divs on one row.

Only one class gets applied at a time, it correlates to a media query. You don't have to apply all for colums though, I believe it will hold it's position of the last column size, and if you want to only have one column class than I believe medium is the default go-to.