📜 ⬆️ ⬇️

12 reasons to hate XHTML

I would like to publish in web development, but I didn’t have enough karma, I’ll post it here for now.
Based on a recent review of HTML5, I wanted to consider the main reasons why using XHTML can be considered inappropriate. These reasons were collected from various sources and added based on my own experience.

So, the main reasons why you should not use XHTML:

1. From the SEO point of view , in ordinary HTML you have to write less code, which means that HTML is more optimized for search engines than XHTML;

2. From the point of view of copyright protection for content (for those who are relevant) - HTML is much more difficult to parse (automatically copy) than XHTML, which is designed to facilitate parsing;
')
3. From the point of view of reliability - the parsing of the XML document stops at the first error, which makes it impossible to display the page. In turn, HTML will never invoke the Mozilla / FF yellow screen of death , which may appear from the smallest incorrect code: an unclosed tag or intersecting tags, or a tag with an invalid attribute, etc. There are cases when IE6 gave an error and refused to load further the page (and this is the loss of visitors, ie, profits from the site) - the color for such a screen of death has not yet been invented. The problem was solved simply by changing the xhtml format to html. Do not forget that the sites have content that does not depend on the developer, for example, contextual ads (Direct, Adsense);

Well, a few more reasons, smaller:

4. Internet Explorer 6, and even 7 versions do not support application / xhtml + xml;

5. Layout in HTML easier and more convenient;

6. Search engines do not index XHTML as XML documents;

7. Document.write in scripts in XHTML just does not work. We'll have to rewrite using the DOM functions;

8. In the DOM functions themselves, you must omit all element names in lower case. Same for selectors in styles. In XHTML, the case of letters is significant.

9. Contents of elements

Source: https://habr.com/ru/post/19977/


All Articles