SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Northampton, UK
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Equal width cells with css?

    Hi, I'm trying to make a horizontal menu bar of link in CSS.

    Now I would normally do this with <ul> and <li>s.

    However here I want each cell to be of equal width and for there to be a spacer between each one.

    What would the best way to do this in CSS be?


    The only way I've got at the moment is putting right margin on the <li>s, and giving the last one a class that 0's the right margin. As for the width it's manual calculation and setting it in pixels, doesn't seem like an elegant way of doing things at all.

    See image for what I'm trying to achieve
    Attached Images Attached Images

  2. #2
    SitePoint Addict Poiesis01's Avatar
    Join Date
    Jun 2007
    Location
    Cape Town
    Posts
    233
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried li {width: 80px} ?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Northampton, UK
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Poiesis01 View Post
    Have you tried li {width: 80px} ?
    Yeah that's how I'd do it, but how to get the gaps between the cells, is the way I suggested the neatest way of doing things?


Bookmarks

Posting Permissions

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