Click to See Complete Forum and Search --> : Aligning a text box's text centrally


hammerslane
09-22-2003, 10:33 AM
does anyone know how to get the actual text of a text box aligned centrally? if you try to align the <input> tag like this<input type=text name=customername align=center> then it just aligns the whole text box to the middle of the page. I think it might have something to do with the 'style:' attribute?
thanks for any help :)
l8rz

pyro
09-22-2003, 10:36 AM
Yep, you want to use CSS to do this:

<input type="text" style="text-align: center;">

hammerslane
09-22-2003, 10:38 AM
wow! i guess they dont call you supermod for nothing pyro! you're top... and mightily quick might i add :)
cheers
regards

hammerslane
09-22-2003, 10:40 AM
another thing.... is there a way to do the same thing with a drop down box? i tried the style="text-align: center"but it didn't work (i tried it on the <SELECT> tag and the <option> tag)....

pyro
09-22-2003, 11:42 AM
Adding the code to your <select> tag will work in browsers more compliant than IE, such as Mozilla, NN, and Opera... Yet another example of IE's inferiority... ;)