Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Vertical Centering

Options
  • 04-01-2005 8:40am
    #1
    Registered Users Posts: 885 ✭✭✭


    Hi just a quick one. I am looking to center a simple image vertically to display loading while the page loads nomatter what the users resolution is but am finding it hard to do. Can anyone explain how to do this.

    Thanks
    John.


Comments

  • Registered Users Posts: 6,511 ✭✭✭daymobrew


    table width=100% height=100%
    One row with one cell
    td valign=center align=centre
    img in the one cell.


  • Closed Accounts Posts: 7,488 ✭✭✭SantaHoe


    Create a 1x1 table of 100% height and 100% width, then use center alignment for both horisontal and vertical for content within the table.

    Snippet...
    <table style="width: 100%; height: 100%;" border="0">
    <tbody>
    <tr>
    <td style="text-align: center; vertical-align: middle;"><img src="blah.jpg"><br>
    </td>
    </tr>
    </tbody>
    </table>
    


  • Registered Users Posts: 885 ✭✭✭clearz


    Thats what I was trying. When I took out the DOCTYPE tag at the top it worked. ???

    tnx


  • Closed Accounts Posts: 2,525 ✭✭✭JustHalf




Advertisement