Hello. I have a simple address form that was working well until I decided to change the State field from an input box to drop-down box.
I have FireBug installed, and I just cannot figure out why the State field is not in alignment with the City and Zip fields. They should all be in one row.
I would appreciate help figuring out what is wrong with my CSS.
Here is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
form{
margin: 0 auto;
padding: 30px 0;
width: 640px;
}
form label{
display: block;
font-weight: bold;
padding: 1.5em 0 0;
}
form label.sideBySideField{
display: inline-block;
padding: 1.5em 1em 0 0;
}
form input{
display: block;
margin: 0;
}
form input#firstName,
form input#lastName{
width: 22em;
}
form input#Address,
form input#City{
width: 26em;
}
form select{
display: block;
margin: 0;
}
form input#Zip{
width: 6em;
}
</style>
</head>
<body>
<form action="" method="post">
<fieldset>
<legend>My Form</legend>
<!-- First Name -->
<label for="firstName" class="sideBySideField">First Name:
<input id="firstName" name="firstName" type="text" maxlength="35" value="" />
</label>
<!-- Last Name -->
<label for="lastName" class="sideBySideField">Last Name:
<input id="lastName" name="lastName" type="text" maxlength="35" value="" />
</label>
<!-- Address -->
<label for="Address">Address:
<input id="Address" name="Address" type="text" maxlength="40" value="" />
</label>
<!-- City -->
<label for="City" class="sideBySideField">City
<input id="City" name="City" type="text" maxlength="40" value="" />
</label>
<!-- State -->
<label for="State" class="sideBySideField">State
<select id="State" name="State">
<option value="">--</option>
<option value="">AK</option>
<option value="">AL</option>
<option value="">AR</option>
</select>
</label>
<!-- Zipcode -->
<label for="Zip" class="sideBySideField">Zip
<input id="Zip" name="Zip" type="text" maxlength="5" value="" />
</label>
</fieldset>
</form>
</body>
</html>
Sincerely,
Elizabeth