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">
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.
Yes unfortunately XHTML is gone.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With