label float:left; width:100px;
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitionalt//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Implicit labels</title>
<style type='text/css'>
body{
color:#000000; background-color:#ffffff;
font-family:arial, verdana, sans-serif; font-size:12pt;}
fieldset {
font-size:12px;
padding:10px;
width:280px;
line-height:2.4;}
label {
float:left;
width:100px;}
.control {
float:left;
width:150px;}
</style>
</head>
<body>
<form name="frmExample" action="" method="post">
<fieldset>
<legend>Register for our e-mail</legend>
<label for="firstName">First name: </label>
<div class="control">
<input type="text" name="txtFirstName" size="20" id="firstName" />
</div>
<label for="lastName">Last name: </label>
<div class="control">
<input type="text" name="txtLastName" size="20" id="lastName" />
</div>
<label for="email">E-mail address: </label>
<div class="control">
<input type="text" name="txtEmail" size="20" id="email" />
</div>
<input type="submit" value="Subscribe" />
</fieldset>
</form>
</body>
</html>
Related examples in the same category