how do i align these fields in this HTML form?

Helen

New member
I WANT ALL THE BOXES IN THE FORM ALIGNED IN A NEAT WAY ONE UNDER THE OTHER (the X's are the number of characters before each field). PLEASE HELP ME:

XXXXXXXXXXXX:
<input type="text" name="Name" value="" size="20">
<br>

XXXXXXXXXXX:
<input type="text" name="Cardno" value="" size="20" maxlength="16">
<br>

XXXXXXXXXXXX:
<input type="text" name="Address" value="" size="20">
<br>

XXXXXXXXXXXX:
<input type="text" name="Address" value="" size="4">
<br>

XXXXXXXXXXXXXXXXXXX:
<input type="text" name="exp" value="" size="6" maxlength="5">
<br>

XXXXX:
<input type="text" name="Address" value="" size="20">
<br>
 
"XXXXX" should be in a label with a "for" attribute corresponding to the input name. For example:
<label for="Address">XXXXXXX</label>
<input type="text" name="Address" size="4"/><br/>

You can then use CSS to format your labels to a standard width. Usually:
<style type="text/css">
label {float:left; clear:left; width:250px;}
</style>

Keep playing with it until it looks right to you.
 
Back
Top