With all the controversy surrounding tables as a layout option for forms, I've decided to go with an unordered list. I finally have the labels and elements displaying as I intend, however the 'note' div I've added refuses to line up with the inputs above it.
I've included the code below, please excuse the garish background colours I've chosen to help me judge placement! Does anyone have any suggestions as to why this the 'note' div refuses to play along? I'm sure there's a simple solution but I'm completely stumped. Thank you very much in advance.
form.contact label
{
float: left;
position: absolute;
background: red;
}
form.contact input
{
width: 200px;
margin-left: 15em;
}
form.contact .note
{
margin-left: 15em;
width: 176px;
background: yellow;
}
form.contact ul
{
list-style: none;
position: absolute;
padding: 0;
}
form.contact ul li
{
float: left;
clear: left;
width: 100%;
padding-bottom: 1em;
margin-bottom: 10px;
background: pink;
left: 0;
}
<ul>
<li>
<label for="address1">Address Line 1:</label>
<input name="address1" type="text" id="address1" />
</li>
<li>
<label for="address2">Address Line 2:</label>
<input name="address2" type="text" id="address2" />
</li>
<li>
<label for="address3">Address Line 3:</label>
<input name="address3" type="text" id="address3" />
</li>
<li>
<label for="address4">Address Line 4:</label>
<input name="address4" type="text" id="address4" />
<div class="note">This is a note</div>
</li>
<li>
<input type="submit" name="btnSubmit" value="Submit" id="btnSubmit" />
</li>
</ul>
<form class="contact">opening tag and the</form>closing tag in your html code snippet.