WordPress.org

Ready to get started?Download WordPress

Forums

Toolbox
[resolved] [closed] Space between body and page (7 posts)

  1. wpfan1000
    Member
    Posted 2 years 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/

  2. wpfan1000
    Member
    Posted 2 years 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. ]

  3. brunodani
    Member
    Posted 2 years ago #

    Same issue...there is also a space under the footer. Somebody found the solution?

  4. carbis
    Member
    Posted 2 years ago #

    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;
    }

  5. wpfan1000
    Member
    Posted 1 year ago #

    Marking as Resolved

  6. jeromeit
    Member
    Posted 1 year 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..

  7. Andrew
    Forum Moderator
    Posted 1 year ago #

    @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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags