Mobile app version of vmapp.org
Login or Join
Kristi941

: HTML5 `html` `xmlns` attribute Is xmlns appropriate in HTML5? <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> ... </html> Also, which is preferred, <!DOCTYPE html> or

@Kristi941

Posted in: #Html #Html5 #Xml

Is xmlns appropriate in HTML5?

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
...
</html>


Also, which is preferred, <!DOCTYPE html> or <!doctype html>?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Kristi941

2 Comments

Sorted by latest first Latest Oldest Best

 

@Shakeerah822

The HTML5 drafts are partly rather complicated and abstract. But on the basis of somewhat vague statements in them as well as the validator.w3.org behavior (which can be expected to reflect the intentions of the authors of HTML5 drafts, the answers seem to be:

The xmlns attribute is allowed but not required in XHTML syntax (XHTML serialization), In the HTML syntax (HTML serialization), it has no relevance and it does not seem to be listed as allowed, but the validator seems to accept it, perhaps by accident.

In XHTML syntax, the doctype string must be cased as in <!DOCTYPE html>, whereas in HTML syntax, it is case-insensitive.

10% popularity Vote Up Vote Down


 

@Angela700

According to HTML5 Reference, xmlns is relevant for XHTML but not for html5.

DOCTYPE is cas insensitive :


In HTML, the DOCTYPE is case insensitive, except for the quoted string "about:legacy-compat", which must be written in lower case.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme