HTML 5 and XHTML 1.1
html, xhtml
Solution
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:
<button disabled></button>
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:
- HTML/XHTML and MIME type: a short answer about content type and markup syntax.
- All-in-one about HTML and XHTML: a long list of QA that covers different aspects of HTML/XHTML compatibility.
- What to use: a question about what is better to use between HTML and XHTML (of course the answer is it depends but the answer itself is good).
- XHTML/HTML for mobiles: some nice tips about HTML5/XHTML with Apple's devices.
Problem
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?