If this is right, I developed a bad habit, as far as I know based on a W3C manual, of writing XHTML self-closing tags in HTML to make it future-proof.
This link has been bookmarked by 150 people . It was first bookmarked on 15 Mar 2007, by kabs.
-
23 Oct 15
-
22 Feb 14
-
11 Mar 13
-
26 Jun 12
-
14 Jan 11
-
When your website sends a document to the visitor's browser, it adds on a special content type header that lets the browser know what kind of document it's dealing with. For example, a PNG image has the content type
image/pngand a CSS file has the content typetext/css. HTML documents have the content typetext/html. Web servers typically send this content type whenever the file extension is.html, and server-side scripting languages like PHP also typically send documents astext/htmlby default.XHTML does not have the same content type as HTML. The proper content type for XHTML is
application/xhtml+xml. Currently, many web servers don't have this content type reserved for any file extension, so you would need to modify the server configuration files or use a server-side scripting language to send the header manually. Simply specifying the content type in ametaelement will not work over HTTP.When a web browser sees the
text/htmlcontent type, regardless of what the doctype says, it automatically assumes that it's dealing with plain old HTML. Therefore, rather than using the XML parsing engine, it treats the document like tag soup, expecting HTML content. Because HTML 4.01 and simple XHTML 1.0 are often very similar, the browser can still understand the page fairly well. Most major browsers consider things like the self-closing portion of a tag (as in<br />) as a simple HTML error and strip it out, usually ending up with the HTML equivalent of what the author intended.However, when the document is treated like HTML, you get none of the benefits XHTML offers. The browser won't understand other XML formats like MathML and SVG that are included in the document, and it won't do the automatic validation that XML parsers do. In order for the document to be treated properly, the server would need to send the
application/xhtml+xmlcontent type. -
Internet Explorer does not support XHTML. Like other web browsers, when a document is sent as
text/html, it treats the document as if it was a poorly constructed HTML document. However, when the document is sent asapplication/xhtml+xml, Internet Explorer won't recognize it as a webpage; instead, it will simply present the user with a download dialog. This issue still exists in Internet Explorer 7.
-
-
12 Nov 10
Barton PoulsonIf you're a web developer, you've probably worked a lot with XHTML, the markup language developed in 1999 to implement HTML as an XML format. Most people who use and promote XHTML do so because they think it's the “next version” of HTML, and they may have
web programming html xhtml css standards webdesign webdev internet code
-
22 Jun 10
-
27 Apr 10
-
20 Mar 10
-
15 Feb 10
-
01 Jan 10
-
25 Nov 09
-
23 Nov 09
-
23 Oct 09
-
08 Oct 09
-
25 Jul 09
-
24 Jul 09
Luciano FerrerBeware of XHTML If you're a web developer, you've probably worked a lot with XHTML, the markup language developed in 1999 to implement HTML as an XML format. Most people who use and promote XHTML do so because they think it's the “next version” of HTML, a
-
15 Jul 09
-
25 Apr 09
-
08 Apr 09
David CorkingA maverick polemic (from about 2007), but some straightforward and harmless advice.
-
Add Sticky Note
. Due to the rules of Null End Tags, a single slash in an empty element's start tag would close the tag right then and there, meaning
<br/is a complete and valid tag in HTML. As a result, if you have<br/>or<br />, a browser supporting Null End Tags would see that as abrelement immediately followed by a simple>character. Therefore, an XHTML page treated as HTML could be littered with unwanted > characters.This problem is often overlooked because most popular browsers today are lacking support for Null End Tags,
-
-
Add Sticky NoteHTML 4.01 Strict is still what most user agents and search engines are most accustomed to, and there's absolutely nothing wrong with using it if you don't need the added benefits of XML. HTML 4.01 is still a W3C Recommendation, and the W3C has even announced plans to further develop HTML alongside XHTML in the future.
-
I don't see any harm in this advice, even if it appears to defy the standards committees.
-
Me too. I'm still trying to nail down the exact best doctype, as everywhere has conflicting and possibly out of date advice... (and ie8 meta tags seems to make it even more confusing).
http://hsivonen.iki.fi/doctype/ seems to be a good resource.
-
-
-
15 Mar 09
-
10 Mar 09
-
09 Mar 09
-
08 Mar 09
-
07 Mar 09
cs nullptrIf you're a web developer, you've probably worked a lot with XHTML, the markup language developed in 1999 to implement HTML as an XML format. Most people who use and promote XHTML do so because they think it's the “next version” of HTML, and they may have
-
03 Mar 09
-
15 Jan 09
-
14 Jan 09
-
12 Jan 09
-
06 Jan 09
-
12 Dec 08
-
24 Nov 08
-
09 Sep 08
elle mI believe that XHTML has many good potential applications, and I hope it continues to thrive as a standard. This is precisely why I have written this article. The state of XHTML on the Web today is more broken than the state of HTML, and most people don't
-
03 Jul 08
-
-
I believe that XHTML has many good potential applications, and I hope it continues to thrive as a standard. This is precisely why I have written this article. The state of XHTML on the Web today is more broken than the state of HTML, and most people don't realize because the major browsers are using classic HTML parsers that hide the problems. Even among the few sites that know how to trigger the XML parser, the authors tend to overlook some important issues. If you really hope for the XHTML standard to succeed, you should read this article carefully.
-
-
25 May 08
-
21 Apr 08
-
01 Apr 08
-
27 Mar 08
-
21 Mar 08
-
03 Jan 08
-
15 Dec 07
-
09 Oct 07
-
05 Oct 07
-
01 Oct 07
-
14 Sep 07
-
25 Aug 07
-
19 Aug 07
Troy BThe state of XHTML on the Web today is more broken than the state of HTML, and most people don't realize because the major browsers aren't even treating those pages like real XHTML. If you hope for XHTML to succeed on the Web, you should read this article
-
06 Aug 07
-
23 Jul 07
-
13 Jul 07
-
29 Jun 07
-
10 Jun 07
-
19 May 07
-
17 May 07
posavasos"The state of XHTML on the Web today is more broken than the state of HTML, and most people don't realize because the major browsers aren't even treating those pages like real XHTML. If you hope for XHTML to succeed on the Web, you should read this articl
-
16 May 07
-
15 May 07
Jason MockI've seen similar arguments before (namely the hixie article), but this one is making me seriously reconsider as I can't guarantee that every page that I and the people that work for me is 100% valid XHTML and such invalidity can be dangerous, apparently.
-
09 May 07
-
30 Apr 07
-
28 Apr 07
Felipe LavínIf you're a web developer, you've probably heard about XHTML, the markup language developed in 1999 to implement HTML as an XML format. Most people who use and promote XHTML do so because they think it's the newest and hottest thing, and they may have hea
-
26 Apr 07
-
24 Apr 07
Andre MalheiroHTML 4.01 Strict is still what most user agents and search engines are most accustomed to, and there's absolutely nothing wrong with using it if you don't need the added benefits of XML. HTML 4.01 is still a W3C Recommendation.
-
23 Apr 07
-
22 Apr 07
-
19 Apr 07
-
18 Apr 07
-
J. J. DiUbaldi'07Apr. Great overview.
accessibility CSS HTML reference webdesign research standards
-
17 Apr 07
-
16 Apr 07
Public Stiky Notes
http://hsivonen.iki.fi/doctype/ seems to be a good resource.
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.