<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title></title> <style type="text/css" media="all"> form {margin: 0; padding: 10px;} form label { display: block; float: left; clear: left; width: 200px; margin: 0 0 5px 0; } form div { zoom: 1; /* set hasLayout for IE6 and below to trigger quirky float model which means div clear the floats */ overflow: hidden; /* make inputs clear the floats to give the width you need - auto doesn't work here it creates scrollbar */ margin: 5px 0; } form div input { width: 99%; /* FF cuts off right border if this is 100%; */ } </style> </head> <body> <fieldset><legend>The Form</legend> <form method="post" action=""> <label for="first_name">First Name:</label><div><input type="text" name="first_name" id="first_name" value="" /></div> <label for="last_name">Last Name:</label><div><input type="text" name="last_name" id="last_name" value="" /></div> <label for="address_1">Address:</label><div><input type="text" name="address_1" id="address_1" value="" /></div> <label for="city">City:</label><div><input type="text" name="city" id="city" value="" /></div> </form> </fieldset> </body> </html> |