Results 1 to 2 of 2

Thread: Can't get my navigation to center

  1. #1
    Join Date
    Jul 2008
    Posts
    1

    Can't get my navigation to center

    For some reason I cannot seem to get this simple inline unordered list centered within my design. The entire navigation is styled using CSS and it is really straightforward however, the entire thing always aligns to the left. I want it to center left to right within the div that it is sitting. Can someone give me some advice.

    http://www.efotolab.com/home.htm

    Thanks
    Mike

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    All your menu buttons have no width, so they are flexible in width, but you can't centralise something that has no width in the normal way by setting auto margins.

    Your buttons need different widths for different text, so make an id for each with a different width, then make dummy li tags for the two ends. If you don't provide dummy links at the ends the menu bar will be shorter than the page width and you can centralise with a left margin, leaving a space each side which is not green, but perhaps that is what you want. I've assumed that the green color goes full width of the page.

    See
    http://www.wickham43.supanet.com/for...ome080724.html
    and the css file:-
    http://www.wickham43.supanet.com/for...home080724.css

    You can adjust the widths to make the buttons less wide but then make the sides class wider for each side. I should have calculated everything to fit precisely, but to save time I just set the sides class by eye, widening it gradually until they filled the remaining space each side.

    I changed the image and css file urls to suit my directory/folder structure so you will need to adjust these.
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Similar Threads

  1. Tips to a smooth navigation system
    By gaininfo in forum Graphic Design
    Replies: 0
    Last Post: 24 Jul 2008, 06:10 AM
  2. Navigation
    By vannova in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 04 Jun 2007, 09:25 AM

Posting Permissions

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