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

gregory gordon
seal-mask
.a{fill-rule:evenodd;}techdegree
gregory gordon
Full Stack JavaScript Techdegree Student 14,652 Points

Finally, give .wildlife the property and value that forces any padding and border widths into its total width and height

i do not understand what this is asking for im sure its easy but i cant figure out what its looking for.

Jacob Christensen
Jacob Christensen
13,171 Points

They referred to it early in the video if i remember right. you do this (the answer) if you want the border and padding to NOT cause the box to get larger - essentially shrinking the content area. Therefore, you can keep the total box say, 100 pixels wide, and add margin and it will stay 100 pixels wide total. I think the content (right term?) width changes to be smaller.

3 Answers

Hey , in order to define that you have to set the box sizing property to border box:

.wildlife 
{
      box-sizing: border-box;
}
Erick Kusnadi
Erick Kusnadi
21,615 Points

Usually with the CSS Box Model, you have the content, then padding, then margin, and border.

That being said, the total width and height of the element, by default, will only include content.

So let's say you give a button 50% width, and you give it 30px padding on each side so it looks nice. You want the total width of the element to only take 50% , but it will actually take 50% + 30px on each side.

What the question wants you to do is to include the 30px on each side to the 50%. So that the padding gets included into the total width.

The way to do this is by using: box-sizing: border-box;

***css .wildlife{ box-sizing: border-box; }


You wlc :)