accelerator — 2013-01-30T13:05:50-05:00 — #1
I've just tried adding 10px padding to ColumnLeft, but I've found this expands the width of the div and pushes ColumnRight below it.
In general, what padding techniques are best? Should I be padding the div, or should I be padding the h1 and p tags within the div? I need to get an idea of best practice.
accelerator — 2013-01-30T14:08:00-05:00 — #2
Would I be right in saying that the correct technique is to add a container div around the div I want to pad, then add the width property to the container div, and have just the padding on the div I want padded.
ronpat — 2013-01-30T20:40:58-05:00 — #3
At least a couple of choices:
The css box model says that the width of a container is the sum of the declared width plus any padding. So, you can keep the 10px padding but you need to reduce the width value to 580px.
Another method is to add left and right padding or margins to the contained text.
ralphm — 2013-01-30T21:16:50-05:00 — #4
The easiest way is to put a div inside the divs with a width set and put the padding on that inner div, while not giving it a width.