darksoul90
darksoul90

Reputation: 145

HTML5 with XHTML 1.0 syntax what does it mean?

Out teacher told us, that we use HTML5 with XHTML 1.0 syntax. What does it mean? Is this possible? We write only <!DOCTYPE> on the top of the *.html Is it valid? (In HTML5, yes, but what's with the XHTML part?)

Upvotes: 2

Views: 593

Answers (2)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201518

You can write HTML5 with XHTML 1.0 syntax, since HTML5 permits XML syntax and it explicitly allows an XHTML 1.0 doctype as “legacy doctype” in the XHTML syntax.

But if you write just <!DOCTYPE html> at the start, it does not conform to XHTML 1.0, which has specific rules on the doctype thing.

Using XHTML in documents to be delivered on the web is generally an exercise in futility. There is nothing to be gained. But when documents are to be delivered to software other than web browsers, such as e-book readers, using XHTML may make sense.

Upvotes: 2

Afzaal Ahmad Zeeshan
Afzaal Ahmad Zeeshan

Reputation: 15860

You can just think that, XHTML is a blend of HTML and XML.

https://en.wikipedia.org/wiki/XHTML

You declare the <!DOCTYPE html> to help the IE better render the document. For more on that, you can refer to the following document: https://hsivonen.fi/doctype/

I think your teacher just meant to say something like:

When you're writing an HTML document, you must keep a note on the XML standards too.

For example,

<p>Start and end an element.</p>

And all other XML rules.

Upvotes: 1

Related Questions