Place the text in the middle of the screen

B

brucie

in post: <
Olly said:
I need a way of placing the text in the middle of the screen,
horizontally, and vertically. Without using tables.

p{top:50%;width:90%;line-height:2em;margin:auto;margin-top:-1em;text-align:center;position:absolute;}

<p>some text</p>
 
B

brucie

in post: <
brucie said:
p{top:50%;width:90%;line-height:2em;margin:auto;margin-top:-1em;text-align:center;position:absolute;}

sorry i posted the wrong one

p{top:50%;left:5%;width:90%;line-height:2em;margin-top:-1em;text-align:center;position:absolute;border:1px solid green;}

this one even has a sexy green border so you can see how its centered.
 
M

Mitja

brucie said:
in post: < p{top:50%;width:90%;line-height:2em;margin:auto;margin-top:-1em;text-align:c
enter;position:absolute;}

sorry i posted the wrong one

p{top:50%;left:5%;width:90%;line-height:2em;margin-top:-1em;text-align:cente
r;position:absolute;border:1px
solid green;}

this one even has a sexy green border so you can see how
its centered.

I thought red was a skimpier color?
 
O

Olly

I need a way of placing the text in the middle of the screen,
horizontally, and vertically. Without using tables.

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top