3 ms·
One way I get around the box model problem is to add a .padding div to the inside of an object and apply any padding to that. It adds an extra div which some pe
by Vindexus 17y ago
One way I get around the box model problem is to add a .padding div to the inside of an object and apply any padding to that. It adds an extra div which some people don't like, but I don't mind and it beats dealing with box model weirdness.
html:
<div class="300pixelbox">
<div class="padding">
This is 300 pixels wide and has 10px padding.
</div>
</div>
style:
.300pixelbox
{
width: 300px;
}
.300pixelbox .padding
{
padding: 10px;
}