Many Document Types based on XML need a mandatory xmlns attribute on the root element. For example, the root element for XHTML might look like:
<html xmlns="http://www.w3.org/1999/xhtml">
I don't know much about this xmlns attribute. Do I need to add this to all of my pages below my doctype. I was about to do this, but then I read the following on w3schools site:
the HTML validator at w3.org does not complain when the xmlns attribute is missing in an XHTML document. This is because the namespace "xmlns=http://www.w3.org/1999/xhtml" is default, and will be added to the <html> tag even if you do not include it.
So does that mean I don't need to add the xmlns attribute? If so, why did the validator give me that message?
Line 4, Column 6: document type does not allow element "head" here; assuming missing "html" start-tag
<head>
Missing xmlns attribute for element html. The value should be: http://www.w3.org/1999/xhtml
<head>
✉
Many Document Types based on XML need a mandatory xmlns attribute on the root element. For example, the root element for XHTML might look like:
<html xmlns="http://www.w3.org/1999/xhtml">
Bookmarks