Centering text vertically??

liunx

Guest
Hello all!<br />
<br />
Is there any way to center text vertically?<br />
<br />
All ideas welcome!<br />
<br />
Thanks for your time and your help.<br />
<br />
~dmason165<!--content-->Hi dmason165...<br />
<br />
CSS aligns text vertically using this style:<br />
<br />
vertical-align: middle<br />
<br />
In a table, it's vAlign=middle<br />
<br />
Are either of those what your looking for?<br />
k<!--content-->khaki,<br />
<br />
Exactly what I'm looking for! Thank you! As you probably can tell, I'm pretty new at this;) <br />
<br />
Thanks again!<br />
<br />
~dmason165<br />
<br />
PS. Is that YOUR picture?<!--content-->Hi again dmason165...<br />
<br />
Well, if your new to all of this, I really hope that you will learn to layout your pages using CSS ... and not tables.<br />
<br />
It will save you headaches in the future, and it's suprisingly much easier (less complex) than table layout. <br />
Plus... there is a CSS forum here, so getting help should be no problem for you.<br />
<br />
Anyway... I hope I have convinced you (and to answer your other question... yes).<br />
vertically aligned to the middle... horizontally aligned slightly to the right...<br />
;) k<!--content-->Hello everyone!<br />
<br />
I checked the answer given to me in a previous reply for aligning text vertically. It was correct. However, I can't get my text to cooperate. <br />
<br />
Suggestions anyone?<br />
<br />
Thanks!<br />
<br />
~dmason165<!--content-->Hi dmason165...<br />
<br />
Without seeing the code, it's not really possible to tell you what might be wrong.<br />
<br />
It could be as simple as not placing a ; at the end of the style<br />
(vertical-align: middle;)<br />
... or it could be any number of things.<br />
<br />
If you post your code for us, maybe we can spot what is causing your text to "not cooperate".<br />
k<!--content-->I've been pretty careful about syntax. I hope you'll be able to figure this out...I tried for a while with no luck.<br />
<br />
Below, I have attached the code for my page.<br />
<br />
Thanks again for all your help.<br />
<br />
~dmason165<!--content-->try adding this to your style statement on the <p> tag:<br />
position: relative; top: 50%<br />
<br />
I took your file, stripped out everything not needed for the centering (a whole bunch) and fiddled around with it until this worked.<br />
<br />
Good luck<!--content-->Kelley Poulos,<br />
<br />
Thank you! What's weird is that 25% centered the "welcome". It doesn't make sense. If anyone could perhaps tell me why 50% worked for Kelley Poulos and 25% worked for me, I think a lot of people would benefit.<br />
<br />
Thanks again Kelley!<br />
<br />
~dmason165<!--content-->I also made your font smaller. My guess is that the top of the text was centered. I used this to center an image and found 40% looked better to me. It's nice to have that much control, though.<!--content-->
 
Back
Top