Link to home
Start Free TrialLog in
Avatar of Brad Bansner
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!
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

main.css line 10, paragraph margin under the buttons, 1em on the bottom.

p, ul, ol {
    margin: 0 0 1em;
}
Avatar of Brad Bansner
Brad Bansner

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
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Changing margin to padding does seem to fix it. Thanks!