Box Model question

So it sounds like you would add Padding to my <div class=“box”> to give some space between the border and the text? And that way you would only have to do it once on that container, and not on every child element (e.g. <p>), right?

Debbie

Yup.

So it sounds like I can “have my cake and eat it too” for once?

BTW, why is it that if I put a <div> inside my Left Column and add a 1px border, that NetBeans says its “Computed Width = 198px”?? (Isn’t my <div> still 200px with 198px of “usable” space??)

Debbie

Because the border takes up 2px of space. 1px + 1px + 198px (difference) = 200px. If you set the width to auto and add paddings, margins, and borders, then your auto width is the difference, ergo x = width of outer container -border -padding -margin.

Okay, so “Computed Width” (in NetBeans) apparently means “remaining usable area after Margins, Borders, and Padding are taken away from the original <div>”, right?

Debbie

That’s correct.

Okay, I think that gets me squared away for now.

Thanks for all of the help, guys (and gals)!!! :tup:

Debbie