HI,
You could do something like this using inline-block.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
input[type=text]:focus { background:#e4f0f8 }
.formexample {
width:80%;
border:1px solid #000;
margin:20px auto;
text-align:center;
}
.formtest { background:#f9f9f9; }
.formtest fieldset{
padding:20px;
margin:0;
border:none;
display:inline-block;
*display:inline;/* ie6/7 hack for inline block */
zoom:1.0;/* ie6/7 hack for inline block */
vertical-align:middle;
width:50%;
}
.formtest label {
display:inline-block;
vertical-align:middle;
width:25%;
min-width:90px;
text-align:right;
margin:5px 0;
}
.formtest input {
width:60%;
min-width:100px;
margin:5px 0;
vertical-align:middle;
border:1px solid #ddd;
text-align:left;
}
#submit {
border:1px solid #000;
color:#000;
padding:0;
overflow:hidden;
height:25px;
font-weight:bold;
margin:auto;
display:block;
text-align:center;
}
#submit:hover {
background:#000;
color:#fff
}
.formtest div {
border:2px solid #fff;
padding:5px;
}
</style>
</head>
<body>
<div class="formexample">
<form class="formtest" id="form1" method="post" action="">
<fieldset>
<legend>Address Details</legend>
<div>
<label for="firstname">First Name:</label>
<input type="text" name="firstname" id="firstname" />
</div>
<div>
<label for="lastname">Last Name:</label>
<input type="text" name="lastname" id="lastname" />
</div>
<div>
<label for="address1">Address 1:</label>
<input type="text" name="address1" id="address1" />
</div>
<div>
<label for="address2">Address 2:</label>
<input type="text" name="address2" id="address2" />
</div>
<div>
<label for="address3">Address 3:</label>
<input type="text" name="address3" id="address3" />
</div>
<div>
<label for="address4">Address 4:</label>
<input type="text" name="address4" id="address4" />
</div>
<div>
<label for="city">City:</label>
<input type="text" name="City" id="city" />
</div>
<div>
<label for="state">State:</label>
<input type="text" name="state" id="state" />
</div>
<div>
<label class="zip" for="zip">Zip:</label>
<input type="text" name="zip" id="zip" />
</div>
<div>
<label for="tel">Telephone:</label>
<input type="text" name="tel" id="tel" />
</div>
<div>
<input type="submit" name="submit" id="submit" value="Submit" />
</div>
</fieldset>
</form>
</div>
</body>
</html>
It all depends on how you want it to look but something like that should work
Bookmarks