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

Jake Ford
Jake Ford
9,230 Points

[SOLVED] Couldn't I just decrease the column width?

Instead of setting the .col to 50%, I could just set them to 48% or something right? This would accommodate for the whitespace? Or is this bad practice?

2 Answers

Jake Ford
Jake Ford
9,230 Points

Hey Caroline,

I've kind of already answered my own question by now and need to delete this, lol. The whitespace I was referring to was the default whitespace being created by the inline-block columns(Yes, the gutter). The video uses -4px of margin to get rid of the whitespace, but I was thinking maybe just take a little off of the 50% width and make it 48%; so that the two columns would fit on one line. I realize now that using the box-sizing:border-box and adding a little padding does the trick. I just thought the way he added negative margin in the video was a little odd.

Caroline Hagan
Caroline Hagan
12,612 Points

Ah no worries, lol. I'll mark it as solved. ;-) Yeah I think each developer to their own, I personally wouldn't use a negative margin, but maybe there is good theory behind it! It's all so new, I guess we are all finding solutions as we go.

Caroline Hagan
Caroline Hagan
12,612 Points

HI Jake Ford when you say 'whitespace' are you referring to the gap between columns (gutter) or something else?