4 Replies Latest reply: Apr 11, 2011 1:00 AM by Andy Bay RSS

    Good way to give navbar top margin?

    Andy Bay Community Member

      Hi!

       

      I'm struggling with a simple issue:

       

      I have a navigation bar inside my wrapper div. I would like to give the navigation bar some top margin to push it down say 10 px from the top of the wrapper div. But the top margin is not working like I would expect.

       

      Here is my code:

       

      <body>
      <div id="wrapper">
          <div id="navbar">
          <a href="index.htm">Home</a>
          <a href="products.htm">Products</a>
          <a href="terms.htm">Terms</a>
          <a href="shipping.htm">Shipping</a>
          <a href="about.htm">About us</a>
          <a href="contact.htm">Contact</a>
          </div>
      </div>

       

      </body>

       

      #wrapper {
          background-color: #000066;
          min-height:600px;
      }
      body {
          margin: 0px;
          padding: 0px;
          color: #FFFFFF;
          font-family: Arial, Helvetica, sans-serif;
      }
      #navbar {
          background-color: #035665;
          width: 80%;
          margin-right: auto;
          margin-left: auto;
          text-align: center;
      }
      a:link {
          color: #FFFFFF;
          }
      a:visited {
          color: #CCCCCC;
          }
      #navbar a {
          margin-right: 8px;
          margin-left: 8px;
      }

       

      What is a good way to push my navigation bar down from the top of the wrapper div?