Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does HTML 5 need `<html xmlns="http://www.w3.org/1999/xhtml">`

Tags:

html

When writing a html 5 doctype, are you supposed to include the <html xmlns="http://www.w3.org/1999/xhtml"> as you did when previously using HTML4 doctype or should a different xhtml be used?

<!DOCTYPE html>  <html xmlns="http://www.w3.org/1999/xhtml"> 
like image 806
user1830984 Avatar asked Jan 28 '13 14:01

user1830984


People also ask

What does Xmlns http www w3 org 1999 xhtml mean?

The xmlns attribute specifies the xml namespace for a document. Note: The xmlns attribute is required in XHTML, invalid in HTML 4.01, and optional in HTML5.

Is xhtml still used?

Yes unfortunately XHTML is gone.


1 Answers

HTML5 does not require the use of the xmlns attribute as that is specific to XHTML (which means not even HTML 4 uses it either).

If you're just serving regular HTML5, then you can leave out that attribute entirely:

<!DOCTYPE html> <html> 

The xmlns attribute is only required if you're writing and serving XML-serialized HTML5, aka XHTML5.

like image 185
BoltClock Avatar answered Sep 20 '22 05:09

BoltClock