Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 561373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:26:36+00:00 2026-05-13T12:26:36+00:00

Are there any pros to use HTML 4.01 strict over XHTML 1.0 strict (content=text/html)?

  • 0

Are there any pros to use HTML 4.01 strict over XHTML 1.0 strict (content=”text/html)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:26:36+00:00Added an answer on May 13, 2026 at 12:26 pm

    Sure. Your code will be smaller, since you don’t need to include the extra " characters on one-word attributes, / characters on self-closing elements, you can leave out various opening and closing tags, such as </p>, </li>, and even <html>, <head>, <body>, and so on are optional in HTML 4.01 (and HTML5). See Optimizing HTML and Optimizing Optimizing HTML for a few tips on stripping down your HTML; many of these pieces of advice work only in HTML 4.01 or HTML5.

    Now, not everyone needs to minify this much; but if you do, using HTML 4.01 (or HTML5) instead of XHTML can be beneficial.

    Also, Internet Explorer doesn’t actually support XHTML as XHTML; if you send it as application/xhtml+xml, it will just try to download it. So, if you use XHTML, you need to send it to IE as text/html, which will make the browsers just interpret it as HTML. For a somewhat outdated discussion of why XHTML is a bad idea, see XHTML Considered Harmful by Ian Hickson, the current editor of the HTML5 specification (some of these reasons are still valid, some of them are no longer relevant).

    Here are a few examples:

    1. Well-formed XHTML, served as application/xhtml+xml
    2. Well-formed XHTML, served as text/html
    3. Not well-formed XHTML, served as application/xhtml+xml
    4. Not well-formed XHTML, served as text/html
    5. Well-formed HTML5, served as text/html

    Note that the first does not work in IE. The second works in all browsers, but you are just wasting bytes; the browsers don’t interpret namespaces properly, for example, so if you include XML in another namespace, it won’t actually appear in another namespace in your scripts or CSS. The third will display a big error message, and the fourth will display just fine even though it’s not well-formed XHTML (which demonstrates that the browsers are using their HTML parsers).

    You can get the exact same effect as the text/html examples by using an HTML 4.01 doctype, or an HTML5 doctype, as demonstrated in the fifth example (this is also valid HTML 4.01 if you stick the HTML 4.01 doctype into it). If you use HTML 4.01 or HTML5, you can save a lot of space, and you won’t be fooling yourself by sometimes processing the document as XHTML and sometimes processing it HTML.

    Another reason to beware of serving XHTML as text/html is that it’s processed differently depending on whether it’s parsed by an HTML parser or an XML parser. For instance, a self-closing script tag, such as <script type="text/javascript" src="foo.js"/>, is valid in XHTML, and if parsed by an XML parser, will be parsed as an empty element. In HTML, however, this will be seen simply as a script opening tag, and it will “eat” the rest of the document, as the parser keeps parsing assuming it’s inside a script until it finds a close tag. This is likely not what you want, and can trip you up if you sometimes treat a document as XML and sometimes treat it as HTML. Here’s an example of this problem; these two documents display differently in Firefox, even though they have the same contents (Safari appears to treat them the same, so this extent of this problem varies between different browsers):

    • <script/> tag in XHTML served as application/xhtml+xml
    • <script/> tag in XHTML served as text/html

    This is not the only difference between the HTML and XHTML parsers. In HTML, a <table> will have a <tbody> inserted into the DOM implicitly even if you don’t have one in the source; in XHTML, if you don’t specify a <tbody> explicitly, it will not be present in the DOM.

    So, serving XHTML as text/html will make your code larger than it would be if you just used HTML 4.01 or HTML5, and it can lead to confusion if you sometimes process it as real XML and sometimes treat it as HTML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any pros to use the HTML 5 doctype <!DOCTYPE html> , even
Is there any reason not to use the bitwise operators &, |, and ^
I was wondering if there are any obvious pros and cons one should be
Is there any way to check whether a file is locked without using a
Is there any free or commercial component written in .NET (no COM interop) that
Is there any query which can return me the number of revisions made to
Is there any efficiency difference in an explicit vs implicit inner join? For example:
Is there any way to capture the MouseDown even from the .NET 2.0 TextBox
Is there any difference between int on_exit(void (*function)(int , void *), void *arg); and
Is there any known way of listing the WMI classes and their properties available

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.