2 ms·
You can't really. CSS backgrounds are the main reason you need to use padding (instead of margin): margins exist outside an element, while padding expands withi
by joahua 16y ago
You can't really. CSS backgrounds are the main reason you need to use padding (instead of margin): margins exist outside an element, while padding expands within the box itself (beyond the content, but permitting the background to remain visible).
To visualize it, http://hicksdesign.co.uk/boxmodel/ http://hicksdesign.co.uk/boxmodel/ is probably the most oft-cited example - certainly the one I find most helpful.
- Facens 16y agoOk, I was talking about transparent elements, where in fact you have complete choice (at least if you have no borders too).