• Advertisement
Sign in to follow this  

[web] How to centre html objects in middle of the page?

This topic is 4553 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I want to centre a div tag coloured box with text into the middle of the screen, horizontally and vertically. I thought the easiest way to do this is just use a table with one cell. So Im trying to make the table's height 100%, but it won't even budge. 100% width works fine, and on the table im using absolute positioning, any idea why this won't work? Thanks

Share this post


Link to post
Share on other sites
Advertisement
No idea, because it works just fine whichever way I try it, in both Firefox and IE. Show us the code you have.

Share this post


Link to post
Share on other sites
Maybe your code isn't correct, but here's something that I used recently and it worked fine:

<table width="100%" height="100%" align="center" valign="middle">
<tr>
<td>Text that's centered</td>
</tr>
</table>

Share this post


Link to post
Share on other sites
thanks guys, Talonz table thing was basically the same as mine, i don't know why it didn't work before, but its good now,

thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement