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 Foundations Web Typography Responsive Text and Vertical Rhythm: Part 1

Box-sizing:border-box

Hi all,

is it necessary to add in the project to all elements (*) the value

  • { box-sizing:border-box; }

to have responsive text?

Thanks in advance

1 Answer

Kostas Oreopoulos
Kostas Oreopoulos
15,184 Points

if you read documentation of box-sizing here , you will see that it just has to do with how the box size is calculated.

By using border-box, when you define that a block has width 300px and height 300px, everything is included there. Padding, borders and content. It will never grow more than 300x300.

if you use content-box, your content would be 300x300 but everything else would not.

You decide what you want. border-box just has more predictable behavior