Brad Bansner
asked on
Form element appears to be distorting parent div margin/padding
I created a test page to demonstrate what is happening:
https://www.webcemeteries.com/holysepulchre2.org/test.htm
Below the "submit order" and "edit account information" buttons is a white space which I don't want to be there. The space is in-between the elements div#content and div#bottomswirls. It appears to be related to the form element on this page. If I take away the form element, the space goes away.
However, I don't understand why it is there, or what I can do to get rid of it. My margin and padding are set to zero already.
Any advice?
Thank you!
https://www.webcemeteries.com/holysepulchre2.org/test.htm
Below the "submit order" and "edit account information" buttons is a white space which I don't want to be there. The space is in-between the elements div#content and div#bottomswirls. It appears to be related to the form element on this page. If I take away the form element, the space goes away.
However, I don't understand why it is there, or what I can do to get rid of it. My margin and padding are set to zero already.
Any advice?
Thank you!
ASKER
OK. I sort of understand. But why should the margin at the bottom of a paragraph tag cause the background color (which is on the parent DIV element) to have a margin?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Changing margin to padding does seem to fix it. Thanks!
p, ul, ol {
margin: 0 0 1em;
}