Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Padding Navbar Issues

    I am trying to make a navbar for a website, it is a div I have added 'padding: 4px;' to make the text sit better but it seems to be a bit larger than one I did earlier... Any suggestions???

    Earlier Site(Different site entirely):


    CSS For Above Pic:
    Code:
    div.navbar {
    border: 1px solid black;
    padding: 4px;
    text-align: center;
    background: #b2beb5;
    width: 900px;
    margin: 0 auto;
    }
    Site I am Building:


    CSS For Above Pic:
    Code:
    div.navbar {
    text-align: left;
    background: #ffffff;
    width: 900px;
    padding: 4px;
    margin: 0 auto;
    }
    Last edited by gabriel515; 04-23-2011 at 09:37 AM.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Please post your complete code or a link to your page.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    gabriel515 (04-23-2011)

  • #3
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Here is the HTML for the site i am trying to build which needs solved:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="style.css"/>
    </head>
    <body>
    <img class="img1" src="photos/banner.png"/>
    <div class="navbar">
    <p><a href="index.html">Home</a></p>
    </div>
    </body>
    </html>

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    Your current DOCTYPE is incomplete. Use a Strict one instead.

    After that, add
    Code:
    *{
    margin:0;
    padding:0;
    }
    into your CSS to remove all browser specific defaults of margins and paddings from all elements.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Didn't work I want the 2nd navbar to be the same as the 1st?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •