user2382321
user2382321

Reputation: 105

document type does not allow element "div" here; missing one of "object", "ins", "del", "map", "button" start-tag

W3C validation is giving me the above error on the following on the line:

<div id='main' style='border:1px solid #999;'>

in the following 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"><body>
<p>
    <label for="wrap">Quick Reference:</label>
    <div id='main' style='border:1px solid #999;'>
        <div id='wrap' ></div>
    </div>
</p>
</body>
</html>

Thanks in advance

Upvotes: 0

Views: 619

Answers (1)

Quentin
Quentin

Reputation: 943547

You can't have a div inside a paragraph, and the content you do have doesn't look like a paragraph. Replace the p with div (which is a generic block level container for when a more suitable element does not exist in HTML).

Additionally, labels label form controls not divs. You probably should have a heading (possibly an h1 but more likely h2 if there was more context) not a label. Headings also cannot appear inside paragraphs.

Upvotes: 1

Related Questions