- "Width" refers to the content area; Think of it as your βinnerβ box.
- "Fill" is optionally added outside the content area. It could be 0.
- The βborderβ is optionally indented, if any.
- "Margin" is again added abroad, if any.
So, if you have a width of 400, indent on the left 20, right 10, edge 20 (10 on each side) and 4 border pixels (two on each side), your whole box will be 400+20+10+20+4=454px
So, if you tried to put this in a space with a width of only 400 pixels, you need to reduce something; you could, for example, reduce the width by 54 pixels to get a total total of 400.
Note that this does not apply to Quirks Mode, which uses a slightly different box model, as indicated in Sean's answer. This only applies to IE without a proper doctype; It is usually advisable to avoid the fad regime
source share