I am learning HTML 5 and have a question:
Can HTML 5 be used in XHTML 1.1 documents?
If yes, then could anybody give an example?
I am learning HTML 5 and have a question: Can HTML 5 be used
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Do not confuse XHTML and HTML.
XHTML is HTML ruled to be a valid XML document. Actually the XHTML 1.1 standard does not apply to HTML 5 but to HTML 4.01.
What does it mean? You can pick a valid XHTML 1.1 document and it’ll be a valid HTML 5 document but the counter-part is not always true. For example:
It’s valid HTML code (it doesn’t matter which version) but it’s not a valid XML statement (then it’s not a valid XHTML document) because of the empty attribute. World is full of these examples (just Google), HTML is very relaxed about syntax (and HTML 5 didn’t change this direction) and there are some other differences too (here, for an example). Moreover the HTML 5 standard introduced new tags that aren’t part of XHTML 1.1 standard so a fully featured HTML 5 document (despite the syntax) won’t be a valid XHTML 1.1 document.
References
Here a short list of good reference about this topic, selected from SO answers: