On 11/12/09 10:59, Climis, Tim wrote:
> I know this was on the list not long ago, but I can't seem to find it again.
>
> I have a bunch of list items, each with a div inside it. I want the list
> items to butt up against each other, and the divs to have space around them.
> Normally I would do this with padding on the list item, but I need the list
> item content areas to butt up. So I want to put a margin around my divs, but
> have it not bleed out of the list item. How do I contain my margins?
>
> ---Tim
>
Hi Tim,
I don't think you've given us enough information to come up with an
exact solution... I wanna see da code! :) But I think your problem
looks like it's related to collapsing margins and you need to make your
vertical margins not collapse.
There's a section in the CSS 2.1 spec that gives all the rules
about when margins do or do not collapse :
http://www.w3.org/TR/CSS21/box.html#collapsing-margins
You probably need to change the DIVs that are inside of the LIs so that
the margins don't collapse. Maybe you just need to float the DIVs?
--
*Ghodmode*
www.ghodmode.com <http://www.ghodmode.com>
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/