Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Converting" XHTML 1.0 Strict to HTML5

OK folks,

So I have a valid XHTML 1.0 Strict webpage. I'm aware of the differences between XHTML and HTML, but, what are the differences between XHTML and HTML 5?

Would a 'conversion' be as easy as changing the Doctype, and it would all still validate OK?

Or, are there markup differences that would need to be changed first?

Thanks!

Jack

like image 326
Jack Avatar asked Jun 26 '10 09:06

Jack


People also ask

Does HTML5 allow the use of XHTML?

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.

What is XHTML 1.0 transitional?

XHTML 1.0 Transitional is the XML equivalent of HTML 4.01 Transitional, and includes the presentational elements (such as center , font and strike ) excluded from the strict version.

Is XHTML strict?

There is no strict rules on structure when using HTML, but you should follow strict structure rules in XHTML. If you are using HTML, then you can use upper case and lower case for tags and attributes However, in XHTML, tags and attributes are strictly lower case.


1 Answers

To summarize this post and this post...

All you need to do to start taking advantage of the benefits of HTML5 is to convert your doctype from XHTML to HTML5. HTML5 is compatible with XHTML.

If you want to introduce new HTML5 tags, you will also want to add a polyfill like Modernizr so that Internet Explorer can figure out how to render the new HTML5 elements.

like image 115
Andrew Avatar answered Oct 24 '22 04:10

Andrew