Hello
A bit risky a standalone example of page without a DTD
Try 84 %
I have changed a few things to get the margins on the div to work in FF NS
Its runs now in IE6 FF NS7 OP7 Moz 1.8
PS i think you do not need to clear the float's because of the separete container (div's) see stript version
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" xml:lang="en" lang="en">
<head>
<title>12345 12345 12345 12345 12345</title>
<style type="text/css">
div.row{
width: 700px;
height:24px;/* */
}
span.col1{
width: 15%;/* */
float: left;
text-align: right;
padding-right: 5px;
}
span.col2{
/* width:80%; */
float:left;
text-align:left;
margin: 0 0 0 20px;
}
.clear-both{
clear: both;
}
.mt{margin:20px 0 0 0;}
</style>
</head>
<body>
<form action="x">
<div class="row">
<span class="col1">First name:</span>
<span class = "col2"><input type="text" name="firstname" /></span>
<div class="clear_both"></div>
</div>
<div class="row">
<span class="col1">Last name:</span>
<span class="col2"><input type="text" name="lastname" /></span>
<div class="clear_both"></div>
</div>
<div class="row">
<span class="col1">Email address:</span>
<span class="col2"><input type="text" name="emailAddress" /></span>
<div class="clear_both"></div>
</div>
<div class="row mt">
<span class="col1"> </span>
<span class="col2"><input type="submit" name="submitx" value="Submit" /></span>
<div class="clear_both"></div>
</div>
</form>
</body>
</html>
Stript
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" xml:lang="en" lang="en">
<head>
<title>12345 12345 12345 12345 12345</title>
<style type="text/css">
.row{
width: 700px;
height:24px;/* */
}
.col1{
width: 15%;/* */
float: left;
text-align: right;
}
.col2{
text-align:left;
margin: 0 0 0 20px;
}
.clear-both{clear:both;}
.mt{margin:20px 0 0 0;}
</style>
</head>
<body>
<form action="x">
<div class="row">
<span class="col1">First name:</span>
<input type="text" name="firstname" class="col2" />
</div>
<div class="row">
<span class="col1">Last name:</span>
<input type="text" name="lastname" class="col2" />
</div>
<div class="row">
<span class="col1">Email address:</span>
<input type="text" name="emailAddress" class="col2" />
</div>
<div class="row mt">
<span class="col1"> </span>
<input type="submit" name="submitx" value="Submit" class="col2" />
</div>
</form>
</body>
</html>
Bookmarks