vForums Support > Programming & Coding :: Programming Discussion :: > Aligning text in smack center of a page
Aligning text in smack center of a page - Posted By ashkir (ashkir) on 6th Jan 10 at 10:25am
I want to align my splash image/text in the smack center of the page, but I cannot seem to figure this out.
Anyone know of a way to do this? I mean for both valign and center align (yes I know firefox disobeys many center tags now).
Re: Aligning text in smack center of a page - Posted By Aiken (ionfortuna) on 6th Jan 10 at 5:43pm
Surround the text with a tag with the attributes of align and valign may work, you just need to find the right tag that will work for your needs
Re: Aligning text in smack center of a page - Posted By Michael (wrighty) on 6th Jan 10 at 6:49pm
Aligning vertically is complex. Google it because as far as I remember it involves some JavaScript etc. The only other option is to just add some margin to the top of the image a nice small number just to push it away from the top of the browser.
Re: Aligning text in smack center of a page - Posted By dog199200 (dog199200) on 6th Jan 10 at 10:04pm
why not just do <div valign="center" align="center">*splash page images code here*</div>
if you don't assign a class to the div, then it wont have a border of anything.I do it on my sites all the time and I used firefox up until a few days ago.
Re: Aligning text in smack center of a page - Posted By Michael (wrighty) on 6th Jan 10 at 10:42pm
[quote29235]why not just do <div valign="center" align="center">*splash page images code here*</div>
if you don't assign a class to the div, then it wont have a border of anything.I do it on my sites all the time and I used firefox up until a few days ago.
I'm 99.9% sure that it won't center vertically to the whole page.
Re: Aligning text in smack center of a page - Posted By Aiken (ionfortuna) on 6th Jan 10 at 11:55pm
Unless you set the height and width of the div
Re: Aligning text in smack center of a page - Posted By Michael (wrighty) on 7th Jan 10 at 2:07am
Even then it causes problems as far as I remember. I remember it's not as easy as that. =/
Re: Aligning text in smack center of a page - Posted By ashkir (ashkir) on 7th Jan 10 at 4:56am
[quote29235]why not just do <div valign="center" align="center">*splash page images code here*</div>
if you don't assign a class to the div, then it wont have a border of anything.I do it on my sites all the time and I used firefox up until a few days ago.
Firefox ignores valign too :[
Re: Aligning text in smack center of a page - Posted By Aiken (ionfortuna) on 7th Jan 10 at 6:38am
FF doesn't ignore valign for me, I have it in a <td> tag on my forum and it works
Re: Aligning text in smack center of a page - Posted By Michael (wrighty) on 7th Jan 10 at 6:56am
aiken what you have, isn't what the OP wants.
Re: Aligning text in smack center of a page - Posted By Aiken (ionfortuna) on 7th Jan 10 at 4:37pm
I have Windows Vista with the latest version of FF
Re: Aligning text in smack center of a page - Posted By dog199200 (dog199200) on 7th Jan 10 at 8:05pm
[quote29248][quote29235]why not just do <div valign="center" align="center">*splash page images code here*</div>
if you don't assign a class to the div, then it wont have a border of anything.I do it on my sites all the time and I used firefox up until a few days ago.
Firefox ignores valign too :[
Thats funny, cause I do it all the time
is anything you can do it via CSS and using the div tags, using a class.
Re: Aligning text in smack center of a page - Posted By Ross (admin) on 10th Jan 10 at 12:18am
I believe there is a CSS way to do it provided you know its' height. I believe the idea is to put it in a container with some absolute positioning of 50% top and a negative top margin.
If you want, I can try to dig it out from my notes?
Re: Aligning text in smack center of a page - Posted By ashkir (ashkir) on 12th Jan 10 at 7:10am
[quote29332]I believe there is a CSS way to do it provided you know its' height. I believe the idea is to put it in a container with some absolute positioning of 50% top and a negative top margin.
If you want, I can try to dig it out from my notes?
I decided to do something new. Thanks though Ross. ^^.