Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By TheGAME1264

Thread: Navigation Bar Help

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    2
    Member #
    36806

    Navigation Bar Help

    Hi Everyone,

    Sure this one wont be much of a challenge for you guys!

    Currently having problems with my navigation bar, its leaving space above and to the right of the bar itself, so basically the background color of the bar is of the body instead of the wrapper, i'm also finding it hard to have the bar neatly in the center of the page as appose to either the left or the right, please see below for my page in code pen, please click edit at the bottom for coding:

    CodePen - A Pen by looking2learn

    Any help appreciated!

    Kr

    Joshua:

  2.  

  3. #2
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Play with your CSS - try changing it as follows -

    #navigation ul {
    width 100%;
    float:right;
    margin:0;
    padding:0;
    border:1px solid #BBB;
    background: #FFF;
    }




    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  4. #3
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    You don't actually need a float at all for this navigation. If you want it centered, you're better off not using one anywhere. Picking up on what Mare did:
    Code:
    #navigation ul {
    width 100%;
    text-align:  center;
    margin:0; /* you need to set margins and padding to 0 or you get weird gaps. */
    padding:0;
    border:1px solid #BBB;
    background: #FFF;
    list-style-type:  none;
    }
    That wil give you a centered, unordered list. The next thing you'll want to do is this:
    Code:
    #navigation ul li {
       display:  inline;
       margin: 0;
       padding: 0;
    }
    #navigation ul li a {
        line-height:  (however high your navbar is):
        padding: (whatever padding you want to give the navbar items).
    }
    That way, you won't have floats and you won't even need to deal with The Immutable Law of Floats.
    AlphaMare likes this.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  5. #4
    Junior Member
    Join Date
    Jul 2013
    Posts
    2
    Member #
    36806
    ty guys! very helfpful

  6. #5
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    No worries. Are you all figured out now?
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:18 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com