Stormie Stormie - 1 year ago 107
CSS Question

My nav is undefined, even with my document type declared - My index page, fails to validate via xhtml 1.1 standards

I receive the validation error " Line 38, Column 6: element "nav" undefined "

<div id="header">Leon's CS150 Assignment</div>
<nav> <!-- this is the line quoted in my error message -->
<a class="Menu-Item" href="#">Home</a>
<a class="Menu-Item" href="about.html">About</a>
<a class="Menu-Item" href="cv.html">CV</a>
<a class="Menu-Item" href="../wordpress">Wordpress</a>
<a class="Menu-Item" href="../webshop/catalog">Webshop</a>

My nav is clearly defined in my CSS and has been fine until I tried to validate, does anybody know why this is happening? I've even declared the document type.

Thanks in advance.

Answer Source

You are using the incorrect DOCTYPE for HTML5.

The <nav> element is defined in the HTML5 spec, but your document is not using HTML5.

You need to use the following doctype

<!DOCTYPE html>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download