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

    Exclamation Right padding and margin not working?

    Hi, I've currently making my website and love Google's bar across the top and would like to have something similar on my own site (www.skiroid.com). I've got it all coded as far as I know but for some reason the links floating to the right haven't got the padding and margin like on the left.

    Could anyone help me solve this. Thanks a lot.

    CSS properties
    #navbar {
        top: 0px;
        left: 0px;
        height: 30px;
        width: 100%;
        padding: 0px 5px 0px 5px;
        background-color: #333;
        position: fixed;
    #itemleft {
        line-height: 30px;
        font-size: 13px;
        padding: 0px 7px 0px 7px;
        float: left;
    #itemleft:hover {
        background-color: #555;
    #itemright {
        line-height: 30px;
        font-size: 13px;
        padding: 0px 7px 0px 7px;
        float: right;
    #itemright:hover {
        background-color: #555;
    HTML code
    <div id='navbar'>
        <span class='classnav'><a href='http://www.skiroid.com/'><div id='itemleft'><b><font color='white'>Skiroid</font></b></div></a></span>
        <span class='classnav'><a href='#'><div id='itemleft'>WoW Website</div></a></span>
        <span class='classnav'><a href='#'><div id='itemright'>Support</div></a></span>
        <span class='classnav'><a href='http://www.skiroid.com/account/sign-out.php'><div id='itemright'>Sign out</div></a></span>
        <span class='classnav'><a href='http://www.skiroid.com/account/manage.php'><div id='itemright'>$dbfullname</div></a></span>

  • #2
    Mr. is offline
    Regular Coder
    Join Date
    Feb 2011
    Thanked 4 Times in 4 Posts
    Just add...

    margin-right: 30px;

    to your

    Or if you don't want that margin added to each link, wrap the two links in div and add some right margin to it.


    Posting Permissions

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