Welcome visitor
* Login
* Register
It is currently September 20th, 2019, 9:31 am
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 3 posts ] 
Author Message
  text right on the middle of the screen
PostPosted: March 28th, 2009, 12:06 am 

Posts: 65
how can i make a text appear right on the middle of the screen, no matter the resolution?

thanks.


Top
 Profile  
 
  Re: text right on the middle of the screen
PostPosted: March 28th, 2009, 12:13 am 

Posts: 96
My quick answer would be a table inside a table.

<style type="text/css">
*{margin: 0; padding: 0;}
body, html{height: 100%; width: 100;}
</style>
<table border=2  height="100%" width="100%">
    <tr>
        <td valign="middle" align="center"><table border=2>
    <tr>
        <td>abc...</td>
    </tr>
</table></td>
    </tr>
</table>


And yes, it works on opera, firefox, ie.


Top
 Profile  
 
  Re: text right on the middle of the screen
PostPosted: March 28th, 2009, 4:31 am 
User avatar

Posts: 29
Mr. Strauss.

Why two tables? I would use only one. A table the whole width and height of the page with a single cell. Everything inside the cell can be centered horizontally and vertically using traditional parameters or styles.

My example:

<style type="text/css">
body, html{height: 100%; width: 100%;}
</style>

<table style="width: 100%; height: 100%;">
    <tr>
        <td style="text-align: center; vertical-align: middle;">abc...</td>
    </tr>
</table>


Matrix, now you have two options, use the one suits you better.

REGARDS!

_________________
Ooh, I love your magazine. Especially the 'Enrich Your Wordpower' section. I think it's really...really... really...good.
- Homer Simpson


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron