II can’t think clearly from lack of sleep but I need to figure out where I went wrong with styling this form. I think it’s because the labels are not wrapped around the checkboxes and radio buttons, but I don’t know how to fix it. I’d really appreciate any help you guys can give me to point out the fixes. Sample code below:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
label {
float: left;
width: 150px;
clear: left;
}
form {
width: 500px;
}
p {
clear: both;
}
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<p>
<label for="name">name</label>
<input type="text" name="name" id="name" />
</p>
<p>
<label for="email">email</label>
<input type="text" name="email" id="email" />
</p>
<p>
<label for="phone">phone</label>
<input type="text" name="phone" id="phone" />
</p>
<p>Radios
<input type="radio" name="radio" id="radios" value="r1" />
<label for="radios">R1</label>
<br />
<input type="radio" name="radio" id="radios2" value="r2" />
<label for="radios2">R2</label>
</p>
<p>
<input name="checks" type="checkbox" id="checks1" value="c1" />
<label for="checks1">C1</label>
<br />
<input name="checks" type="checkbox" id="checks2" value="c2" />
<label for="checks2">C2</label>
</p>
<p>
<input type="submit" name="submit" id="submit" value="Submit" />
<br />
</p>
</form>
</body>
</html>