View Full Version : Validation

12-16-2009, 11:52 AM
How would you validate this in xhtml strict? I had a look on google but everyone seemed to be doing it the exact same way.

<label for="contactYou" class="fixedwidth">Best way to contact you?</label>
<select name="contactYou" id="contactYou">

Error Line 111, Column 28: document type does not allow element "label" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag

<label for="contactYou">Best way to contact you?</label>


12-16-2009, 12:08 PM
Those elements need to be inside of a fieldset or paragraph element. A fieldset is probably most semantic. You could use a paragraph but that won't really be semantic. Neither will the other elements.