View Full Version : How do I make text in the very middle?


bane_vagabond
01-11-2004, 10:34 PM
Like, in the middle of a page, not just centering the text, but putting it in the direct middle.

stargurl*
01-11-2004, 10:46 PM
Like, not only in the middle horizontilly, but verticely also?(not bothering to check my spelling)
If that is what u mean, than u can probably do it with div positioning. Search div in the search box on LEIA and you will find some pages on positioning images and text...

Hope that helps :) !

~*Moriah*~

lefty
01-11-2004, 11:57 PM
You could use a table and stick everything inside one giant cell.

bellportal
01-13-2004, 10:56 AM
If you want it in the center horizontally, use the <center> tags.

MaGiCSuN
01-13-2004, 10:57 AM
Like, in the middle of a page, not just centering the text, but putting it in the direct middle.

:)

Love,
Mirna

bellportal
01-13-2004, 06:06 PM
Yes, but what's the difference?

MaGiCSuN
01-13-2004, 06:12 PM
that the person wants the text to be middle (horizontal) and middle (vertical) and not only middle horizontal :)

Love,
Mirna

spikemeister
01-13-2004, 06:38 PM
The following code works however how it will look when other elements are added to the page i have not tried.


<style>
#test {
position: absolute;
left:50%;
top: 50%;
^^
</style>

<body>
<div id="test">test</div>
</body>

MaGiCSuN
01-13-2004, 06:50 PM
that code can be used yeah :) but like you said, you do'nt know what happens if you add more to that div... and the problem with that is that when you have a content of 300pixels width it will still starts in the middle of the screen, but the scrollbar probably will appear.. it's a good code though if you use little things to position with :)

what i used for one of my site's was the <center> tag together with the margin-top that is in the <body> tag. However my layout for that site will look centered in 1024x768 but not in 800x600

i would say do what lefty2217 said, and use a big table. Or use frames, but to me a table would be much easier

Love,
Mirna

spikemeister
01-13-2004, 07:00 PM
Agreed a table would be easier. With all the advancements and recommendations its just a pity that css3 is 'under construction' yet we still have to resort to tables for layout. However when we are left with little in the way of viable alternatives to tables what can we do.

bellportal
01-14-2004, 06:19 PM
Agreed a table would be easier. With all the advancements and recommendations its just a pity that css3 is 'under construction' yet we still have to resort to tables for layout. However when we are left with little in the way of viable alternatives to tables what can we do.
Thanks, Mirna! I think that a table is the only way, then. (Soo sorry for my ignorance! ;))

BTW, When is CSS3 going to come out?

spikemeister
01-14-2004, 06:24 PM
I have no idea really and to be honest it doesnt matter cos until browsers support it its no use really. css2 is still not fully supported so ill just have to be patient. :)

bellportal
01-14-2004, 06:54 PM
I know what you mean! Maybe we should continue this in the Chat forum!

ShannonKay
01-16-2004, 06:38 AM
there's always valign=center for verticle alignment

freakish_dude_
01-16-2004, 07:04 AM
I have no idea really and to be honest it doesnt matter cos until browsers support it its no use really. css2 is still not fully supported so ill just have to be patient. :)


Css1, Css2 and Css3 work fine for me :cheese:

burntsushi
01-16-2004, 07:16 AM
CSS3 is not out yet... CSS3 consists of a ton of cool new features, here's a link if you're willing to read :)

http://www.w3.org/Style/CSS/current-work

And here are a few links on that page, if you just want to go to the cool stuff :)

Borders: (VERY cool i might add!)
http://www.w3.org/TR/css3-border/

Vectors: (FUN!)
http://www.w3.org/TR/SVG/

What we've all been waiting for.. columns!
http://www.w3.org/TR/css3-multicol/

CSS2 is not completely supported by most browsers (mozilla supports the most, by far...)

Alright, so maybe this post was a little off topic... but all the cool kids were doin it ;)

Just saw the oppurtunity to post some cool stuff, that people might be interested in :)

bane_vagabond
01-16-2004, 03:34 PM
Just want to say, I did a table which puts text in the middle.

Question about the table, How many pixels by how many pixels? It might not be centered for 1024 by 768, yet be centered for 800x600. or it might be centered for 1024x768 and not centered for 800x600.

starlet
01-16-2004, 03:54 PM
Do percents instead, 100% by 100%

And if we could try stay a little on topic please everyone else... :)