1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

HOW TO USE valign in CSS

Discussion in 'CSS' started by ahkip, Mar 17, 2006.

  1. #1
    I would like to use valign=top in some of my table. Just wonder how to do it using CSS. Thanks for your time
     
    ahkip, Mar 17, 2006 IP
  2. INV

    INV Peon

    Messages:
    1,686
    Likes Received:
    101
    Best Answers:
    0
    Trophy Points:
    0
    #2
    vertical-align: top;
     
    INV, Mar 17, 2006 IP
  3. ahkip

    ahkip Prominent Member

    Messages:
    9,205
    Likes Received:
    647
    Best Answers:
    0
    Trophy Points:
    310
    #3
    i put something like this in my external css file...but doesn't work

    td{vertical-align:top; border-spacing:none; padding:0; }

    table{border:none; vertical-align:top; border-spacing:none; padding:0; }
     
    ahkip, Mar 17, 2006 IP
  4. INV

    INV Peon

    Messages:
    1,686
    Likes Received:
    101
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I just tested it out and it works for me. Can I take a look at the website and maybe try to figure it out?

     
    INV, Mar 17, 2006 IP
  5. AoaoSo

    AoaoSo Peon

    Messages:
    61
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i got the same problem!

    it seems to be not used in IE
     
    AoaoSo, Mar 28, 2006 IP
  6. cjcpoker

    cjcpoker Peon

    Messages:
    22
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Me too. I was trying to valign within a <div>, and ended up having to use a table within the div.
     
    cjcpoker, Oct 6, 2010 IP
  7. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Use vertical-align instead of the deprecated valign. IE8 will act strange if no doctype is specified at the top of the markup.
     
    Cash Nebula, Oct 10, 2010 IP
  8. dbind

    dbind Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Actually, CSS' vertical-align is NOT the same as the inline valign. Even if you can't stand inline styles, you will have no option sometimes. This is particularly true for tables. Cellpadding, cellspacing and border attributes of table tags require a lot of css to get simple things done, and sometimes it's just not enough. Of course, if you're not into fancy styles, you can always get something similar or good enough with css.
     
    dbind, Jan 20, 2011 IP