+ 9

When should I choose XHTML over HTML5 and when vice versa?

I've seen both XHTML & HTML5 being used in modern times. W3C ( https://www.w3.org ) uses XHTML, and most modern websites use HTML5. I need some guidance on what to choose. Is there any specific reason I could prefer XHTML to HTML5? (Except not for HTML5 APIs) Any constructive advice is appreciated. Thanks in advance.

25th Jun 2018, 6:48 PM
DAB - avatar
4 Answers
+ 13
One thing, other than the syntax, that makes XHTML stand out is its harsh restrictions, which can be a pain to deal with. You kind of answered the question; the extended API and Flash deprecation is what makes HTML5 stand out, plus HTML5 made XHTML not that useful anymore; so if you dont really need the API, go XHTML. The true reason why you may need to use XHTML over 5 is restrictions such as slow relays, incompatible browsers (with 5), or for some reason no one knows how to use HTML5 I say go HTML5 for everything. Its standard, simple, and has pretty much everything you'll need
25th Jun 2018, 6:58 PM
「HAPPY TO HELP」 - avatar
+ 4
xhtml is also very useful if you need to parse your own website for some reason or want to make your website easily parsable by other people, because you can basically use a xml parser(but such problems are easily fixed by something like the tidy library)
25th Jun 2018, 8:59 PM
Max - avatar
+ 4
DAB Only as an annotation: your post is not OFF-TOPIC. You are asking a totally valid question for this space :)
26th Jun 2018, 12:04 AM
Mickel - avatar
+ 3
html 5 has new semantic (meaningful) elements that are important in order to best describe content ! header, footer, nav, main, article, section, aside....
27th Jun 2018, 10:41 AM
Lisa F
Lisa F - avatar