If you set you page
<!DOCTYPE html>
Do you need an html tag like
<html xmlns="http://www.w3.org/1999/xhtml">
after it?
Cheers guys.
In any HTML version other than XHTML versions, the <html>
tag is not needed and does not have any effect as such. However, the tag is useful for specifying the main language of the content of the entire document, e.g. <html lang="en">
.
In XHTML, the tag is always required and must have the xmlns
attribute as in the example. (It may additionally have other attributes.) The tag is required, because the html
element is present in any XHTML document, and XHTML never allows start tag omission. The attribute is required because a specific XHTML rule says so.
This has nothing to do with the doctype issue. Using <!DOCTYPE html>
is nowadays common and often seen as “the HTML5 doctype”. The above still applies, since HTML5 has two alternative syntaxes, the HTML syntax and the XHTML syntax.