Click to See Complete Forum and Search --> : Text Alignment after input box


kscottj
01-03-2003, 01:04 PM
Does anyone know how to align text after an input box? By default it seems to align at the "baseline" I however want it to align in the middle. Can it be done without seprating the text into another table ? Example (note- not complete input description to reduce size):

<td colspan="2">
<div align="left">
<input type="text">
State: <-----add something to valign middle???
<input type="text" ">
Zip Code: <-----add something to valign middle???
<input type="text">
Country: <-----add something to valign middle???
<input type="text" >
</div>
</td>

Anyone?

Thanks,
Scott

pyro
01-03-2003, 01:32 PM
This will move the text up 2 pixels. You can do more or less to suit you needs.

<td colspan="2">
<div align="left">
<input type="text"><font style="position:relative; bottom:2;">State:</font>
<input type="text"><font style="position:relative; bottom:2;">Zip Code:</font>
<input type="text"><font style="position:relative; bottom:2;">Country:</font>
<input type="text">
</div>
</td>

kscottj
01-03-2003, 01:51 PM
Thanks!! you are the best!!!!

-Scott

kscottj
01-03-2003, 02:29 PM
Sorry, one more thing:

Any idea on how to battle the differences I get between netscape and IE?

Thanks,
Scott

kscottj
01-03-2003, 02:33 PM
Ok I think I got it --- this seems to work:

<font style="position:relative;vertical-align: 40%;">State:</font>

Thanks again,
Scott

Stefan
01-04-2003, 04:31 AM
Originally posted by pyro
[B]This will move the text up 2 pixels.

<input type="text"><font style="position:relative; bottom:2;">State:</font>
<input type="text"><font style="position:relative; bottom:2;">Zip Code:</font>

Um, bottom:2; is incorrect CSS. bottom:2px; however has a chance of working crossbrowser.

Also, why use <font>?

<input type="text"><span style="position:relative; bottom:2px;">Zip Code:</span>

seems like a better option.

Stefan
01-04-2003, 04:34 AM
Originally posted by kscottj
style="position:relative;vertical-align: 40%;">State:


If you are using vertical-align: you have no use for the position:relative part. It's only bloating your code.