SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2002
    Location
    New York, NY
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    vertically aligning an image

    i'm sure this is relatively simple, but does anyone know how to vertically align an image or table, etc. so that it is centered vertically on the page? that is to say there is an equal amount of space above and below the element on the page
    thanks

    zing

  2. #2
    I'm NOT an Addict ! TheRock's Avatar
    Join Date
    Jul 2001
    Location
    Earth ... maybe
    Posts
    401
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is a "valign" option in many tags of HTML...including <table> and <img>
    -*-
    B-School Forums - GMAT / MBA / Admissions discussions
    -*-

  3. #3
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope, the valign attribute is only applicable to vertical alignment in cells. It can be applied to COL, COLGROUP, TBODY, TD, TFOOT, TH, THEAD, TR, and the possible values are top | middle | bottom | baseline. Read more about it.
    Last edited by mattjacob; May 5, 2002 at 15:00.

  4. #4
    SitePoint Zealot
    Join Date
    Mar 2002
    Location
    New York, NY
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well i figured out by trial and improvement that you can specify a table that is the entire height of the page, then, using valign="middle" the image in the table cell is centrally aligned to be in the exact center of the page

    the only problem with this is that the "height" attribute in a table is not technically legal (though it still works). speaking of which, does anyone know the benefits to having your sites xhtml coding fully legal?

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by zing
    speaking of which, does anyone know the benefits to having your sites xhtml coding fully legal?
    Yep -- http://www.nypl.org/styleguide/xhtml/benefits.html

  6. #6
    long gone but not forgotten AljapaCo's Avatar
    Join Date
    Aug 2001
    Location
    Sweden
    Posts
    548
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    small note:
    You really should try to position your images with css!!
    T O B I A S - S T R A N D H | visit my site here
    OPERA7 /MSIE6 /FireFox 1.1/Win2000 /ADSL /17" Screen /1024x768
    god doesn't create genius, he clones me.............


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
  •