Search code examples
htmlcssheaderfooterfill

HTML CSS - Making top bar and bottom bar reach the edges


This is my HTML just for top part.

<div id="headerContainer">
    <!--Logo-->
    <img src="pic_mountain.jpg" alt="Mountain View" id="logo">
    <span id="pageName">Untitled Page Name</span>
</div>

This is the CSS just for top part.

#navContainer{top: 0;
    float: left;
    margin-top: 20px;
    height:auto;
    width:auto;

    margin-left: -10px;
}

This code almost works, but it leaves a gap on the left side can I please have help, how do I fit the gap?

I only want to use CSS and HTML, not any weird external stuff.


Solution

  • Try to add

    body {
      margin: 0;
      padding: 0;
    } 
    

    to your CSS File, this should close the Gap. If this is not what you desired feel free to write a comment :)