treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Unintended Wordpress Header Padding

  • Hello Everyone!

    This is my first post, so please be kind and thanks in advance.

    I am working on styling wordpress as inspired by Chirs' video cast series. I have been following his instructions loosely to fit my own needs, and have been having a decent amount of success until I realized that my images within the header are not sitting snugly at the top of the browser. I suspected this being some type of padding issue, but when I tried declaring padding: 0px; on all of my CSS divs/etc., nothing changed. . . any help or suggestions would be awesome.

    Here is a link to the page in progress: http://www.potlatchpresents.com/test/
    Here are the relevant parts of the header.php and my CSS:

    	<body>

    <div id=\"wrapper\">
    <div id=\"logo\">
    </div> <!-- END logo -->
    <ul id=\"nav\">
    <li> <a id=\"home\" href=\"/\">home</a></li>
    <li> <a id=\"about\" href=\"/\">about</a></li>
    <li> <a id=\"contact\" href=\"/\">contact</a></li>
    <li> <a id=\"merch\" href=\"/\">merch</a></li>
    </ul><!-- END nav -->

    <div id=\"banner\">
    </div>


    #wrapper {
    min-height: 100%;
    height: auto !important;
    height: 100%;
    width: 960px;
    margin: 0 auto -150px;
    padding: 0px;
    }


    #logo {
    height: 240px;
    width: 960px;
    margin: 0 auto;
    padding: 0px;
    background: url(images/logo.jpg) no-repeat;
    }

    #banner { background: url(images/banner.jpg) no-repeat;
    padding: 0px;
    height: 30px;
    }

    ul#nav {
    list-style: none;
    overflow: hidden;
    padding: 0px;
    margin: 0 auto;
    width: 840px;
    }
  • You can get rid of the gap by declaring:
    body {  padding:0; margin: 0; }

    or better still, reset margin and padding on all elements:
    html * { padding:0; margin: 0 }
  • Thank you so much! kind of a newbie mistake, I know!

    This is my first well-thought-out and serious webpage attempt. I will make sure to post it when it is finalized.

    Take care!
    -Darren
  • No problem, we've all been there!