SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Oct 2003
    Location
    Vancouver, Canada
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to Center (Horz. & Vert.) a Table/Div

    Hi, Im making a splash page and would like to preferably use a div (layer with CSS) to center a image in the middle of the screen horizontally and vertically. So no matter the screen size it will always be centered, even if the windows resized.

    I can do it using <div align="center"> but that only does it for horizontal, and <table width="100%" height="100%"> doesnt work either (I would put the image inside and do a <TD> align.

    Any ideas?
    Last edited by Thomas_Szafran; Jan 7, 2004 at 22:14.

  2. #2
    SitePoint Member
    Join Date
    Jan 2004
    Location
    columbus ohio usa
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML Code:
    <table width="100%" height="100%"><tr><td>
    <div align="center"><img src="logo.jpg" width="59" height="59"></div>
    </td></tr></table>

  3. #3
    SitePoint Member
    Join Date
    Oct 2003
    Location
    Vancouver, Canada
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Doesnt work...

    Quote Originally Posted by relaxzoolander
    HTML Code:
    <table width="100%" height="100%"><tr><td>
    <div align="center"><img src="logo.jpg" width="59" height="59"></div>
    </td></tr></table>
    Yea I tried that, it doesnt seem to work with the latest version of IE. Seems so simple, anyone?

  4. #4
    SitePoint Wizard Dangermouse's Avatar
    Join Date
    Oct 2003
    Posts
    1,024
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  5. #5
    SitePoint Member
    Join Date
    Oct 2003
    Location
    Vancouver, Canada
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks

    Thanks alot, that was extremely helpful. I learned alot in the last couple hours, looked up so many CSS references.

  6. #6
    SitePoint Member
    Join Date
    Jan 2004
    Location
    columbus ohio usa
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post

    Quote Originally Posted by Thomas_Szafran
    Yea I tried that, it doesnt seem to work with the latest version of IE. Seems so simple, anyone?
    what version of ie are you using?
    i have 6.0.2800 and it works fine.
    [the only other update is 6.0 sp1.]


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
  •