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 CSS Basics (2014) Basic Layout Clearing Floats

Why 46.5% as width of floats??

What calculations did you make to determine the width of resorts and tips as 46.5%, why 46.5%, why not 50%?????

3 Answers

Jason Welsh
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jason Welsh
Treehouse Project Reviewer

I will guess whatever amount I need for gutters between columns and divide the amount and then subtract that from the width of each column, which usually gives me a number like 46.5%. It all depends on the margins, borders, padding, font sizes, etc. and can be changed to anything as long as it all totals 100%.

Without any code, I will have to guess. Generally, 50% is bad because of margins, padding, or borders.

Callum Anderson
Callum Anderson
8,837 Points

As mentioned above, I presume it's a safe figure to use in order to ensure both columns can fit side by side with room for margins, padding and borders.

However, in the previous section, it was recommended to use box-sizing: border-box for all elements. Using border-box would allow for specifying 50% on both columns?