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

Bootstrap Col width problem

Hi there, I cant seem to get my cols to get placed correcly, I mean if I change .col-sm-6{width:47%;} (instead of 50% that bootstrap uses) I get the desired effect, but I feel that im doing something wrong, because this is not normal and its been hours that ive wasted to solve this problem..

Thank you!

4 Answers

Nevermind, all I had to do to add space in my colums was set the border to 15px solid and white, and remove the col margin-right: 15px; Thank you all though!

I'm not entirely sure what you mean - why would you need to change the widths of the grid? It's best to leave the grid as is, and create a custom class for the bespoke widths - this way, if you need the grid at a later date, it's still there, untouched :)

Like, for exemple, I want 1 Col under "Produits" when im on a phone, 2 Cols when im on a tablet, and 3 Cols when im on a desktop, usualy this should work with bootstrap I think, I must be missing something

You didn't enclose your divs correctly. So your semantics is off.

What do you mean by enclose my divs? What should I do to make it work?