Home › Forums › CSS › Margin to 0 on first and last element in wrapper › Re: Margin to 0 on first and last element in wrapper
March 11, 2011 at 7:26 pm
#55677
steveooo
Member
#box is the content wrapper with e.g. a white background whereas the body background is e.g. light blue. So with two different backgrounds you will see the padding of the #box, so your (and my first thought) alternative isn’t suitable for that way.
I am looking for an alternative where you don’t change the padding (of #box) for replacing the function of
#box>:first-child { margin-top : 0 }
#box>:last-child { margin-bottom : 0 }