wpfan1000
Member
Posted 1 year ago #
Hi,
If in a child theme I use this css:
body {
margin: 0;
padding: 0;
}
#page {
margin: 0 auto; /* Center horizontally */
background-color: yellow;
padding: 0;
}
I still end up with a white horizontal space between the top edge of the body (white background) and the top edge of the <div id="page" ....>
Could you please let me know how to get rid of it? I have tried for hours and am turning to alcohol.....
Thanks
http://wordpress.org/extend/plugins/toolbox/
http://wordpress.org/extend/themes/toolbox/
wpfan1000
Member
Posted 1 year ago #
OP here :-)
I managed to find:
html {
margin-top: 28px !important;
}
and found I cannot over-ride it in a child theme
ie
html {
margin-top: 0px !important;
}
Is this what is causing this horizontal space?
If so how can I get rid of it?
[ Please do not bump, that's not permitted here. ]
brunodani
Member
Posted 1 year ago #
Same issue...there is also a space under the footer. Somebody found the solution?
Apologies on the late reply.
This is to do with the way child element margins effect the parent element position in the box model. The space is caused by the margin of the #site-title element inside the header. It's called 'collapsing margins'. There's some good info on it here: http://www.w3.org/TR/CSS21/box.html
The fix is simply:
#site-title {
margin: 0;
}
wpfan1000
Member
Posted 3 months ago #
jeromeit
Member
Posted 2 months ago #
I'm having this issue as well, the site title did not fix it. I'm also having an issue with spacing below the footer..
@Jeromeit you need to create your own thread to discuss your own issues.
Please don't post in others' threads unless you're contributing towards the original posters' issues.