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

HTML How to Make a Website CSS: Cascading Style Sheets Center the Wrapper

christian lian huat toh
christian lian huat toh
7,213 Points

element exceeded it's "MAX-WIDTH" value by setting huge value on left and right "PADDING"

Why did the wrapper exceeded its MAX-WIDTH value when the padding's left and right value is set to 50% or any bigger value..

wrapper {

max-width: 940px; padding: 0 50%; }

why did the width became larger than it's max-width which is 940px??? :)

1 Answer

*{ box-sizing:border-box; }

use this property to add padding within the specified width;

christian lian huat toh
christian lian huat toh
7,213 Points

that solves the problem thank very much :D