#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    17
    Rep Power
    0

    Centering list elements using CSS.


    Hello.

    For the life of me I can not center the <li> in the the <ul> using CSS.

    Here is a link to my code: link.

    What I am trying to do is make the navigation bar elements evenly spaced. I want each element to take up as much room as needed with a padding on either side so that the whole navigation bar is filled with the 6 elements. For a clearer picture of what I am trying to say:

    I can do it using tables, but I am trying to do it using 100% CSS.

    Thank you very much (in advance).

    Field4000
  2. #2
  3. Insignificant Peon
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Tharsis Ridge (Martian lowlands)
    Posts
    194
    Rep Power
    11
    field4000...

    Read this thread at another forum. Pay particular attention to the post by "mipapage" there, where he talks about floating your list items rather than setting them as display:inline when building a horizontal menu, as you are attempting to do.

IMN logo majestic logo threadwatch logo seochat tools logo