When should I choose XHTML over HTML5 and when vice versa? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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
DAB - avatar
3 Answers
+ 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
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
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