Jump to content

Need help debugging


LukeV

Recommended Posts

I'm trying to validate my website here but I get 6 errors, which practically say the same thing about different elements I have laying around. Here's one:

Line 18, Column 10: 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>Username: </label><input type="text" name="username" value=""/>
I'm not very good at understanding the errors here. What did I do wrong?
Link to comment
Share on other sites

You might try wrapping your label + input into a div:

<div><label>Username: </label><input type="text" name="username" value=""/></div>

Labels and inputs are inline elements and, according to the validator, ought to be inside of a block element (p, h1, h2, ..., div, etc.).

Link to comment
Share on other sites

You might try wrapping your label + input into a div:
<div><label>Username: </label><input type="text" name="username" value=""/></div>

Labels and inputs are inline elements and, according to the validator, ought to be inside of a block element (p, h1, h2, ..., div, etc.).

Ah ok. Thanks! That fixed most of the errors. Still have two left though.
Line 37, Column 29: document type does not allow element "ul" here; missing one of "object", "ins", "del", "map", "button" start-tag.<ul class= "todo">
and
Line 48, Column 14: document type does not allow element "h2" here; missing one of "object", "ins", "del", "map", "button" start-tag.<p><h2>Looking for a Designer?</h2></p>
No idea what's wrong :\
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...