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 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2009
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to center a Scrolling nav....

    So I am working on this portfolio site for a friend and the main idea behind this site is it's horizontal scrolling.

    The REAL meat of my problem that I can't seem to figure out is how to "center" the nav (the 4 images) to the "body" as seen in the pictures.

    http://threedash.com/READING/reading01.jpg
    http://threedash.com/READING/reading02.jpg
    http://threedash.com/READING/reading03.jpg

    This is where I am at right now, "threedash.com/READING"



    basically, when the website scrolls, I want that nav to land perfectly in the middle of the sections, regardless of the "viewer" browser's window size.


    Any suggestions or programming would be helpful.

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Code:
    #navigation {
    height:198px;
    left:0;
    margin:125px auto 0;
    /*position:fixed;*/
    top:0;
    width:650px;
    }
    will centre your #navigation div. When an element has a width (and the page has an appropriate doctype for IE), setting left and right margins to auto will centre the element.


  •  

    Posting Permissions

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