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

    Join Date
    Feb 2004
    Location
    the Netherlands
    Posts
    66
    Rep Power
    11

    vertical align in css, without using tables


    Hi,

    i'm making a site, and want the links in my navigation bar to be centered hoizontally and vertically.
    the vertical align centering doen't work.
    does anyone have an idea how to fix it..?

    the site:
    http://www.jarra.nl/_TEST/test4.htm
    the css file:
    http://www.jarra.nl/_TEST/test4.css

    oh, and if you notice any problems by viewing this page in other browsers than ie6, please let me know as well.

    thanks a lot,
    jarra
    http://www.jarra.nl
  2. #2
  3. Cunning Linguist
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2003
    Location
    I used to live at home, now I stay at the house
    Posts
    10,180
    Rep Power
    2038
    Unfortunately, it's not possible to vertically align stuff using just css.

    This is one place where you actually have to use a table with it's default valign="middle" attirbute in the <td> where you put your div/text/whatever...
  4. #3
  5. Wiser? Not exactly.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    5,932
    Rep Power
    4033
    CSS does have a vertial-align property, but from what I've read and my experience with it, it doesn't work very well. One thing you can do is just set the top margin and/or padding on the element.

    Also, your site does have some display problems in mozilla. Attached is a picture of what it looks like.
    Recycle your old CD's, don't just trash them



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Location
    the Netherlands
    Posts
    66
    Rep Power
    11
    thanks a lot for you're help.
    managed to solve the mozilla problem as well...
    http://www.jarra.nl

IMN logo majestic logo threadwatch logo seochat tools logo