{"id":320,"date":"2009-05-15T16:35:58","date_gmt":"2009-05-15T13:35:58","guid":{"rendered":"https:\/\/www.optimiced.com\/en\/?p=320"},"modified":"2009-07-03T14:50:46","modified_gmt":"2009-07-03T11:50:46","slug":"xhtml1-html4-html5","status":"publish","type":"post","link":"https:\/\/www.optimiced.com\/en\/2009\/05\/15\/xhtml1-html4-html5\/","title":{"rendered":"XHTML 1.0 vs. HTML 4.01 (or HTML 5)?"},"content":{"rendered":"<p>If you are a professional Web designer and create HTML\/CSS code by hand for living, then you might be interested in the fact that Dave Shea switched <strong><a href=\"http:\/\/mezzoblue.com\/archives\/2009\/04\/20\/switched\/\">from XHTML 1.0 to HTML 4.01<\/a><\/strong>.<\/p>\n<p>It&#8217;s a fact that:<\/p>\n<p>1) Lately, the <a href=\"http:\/\/dev.w3.org\/html5\/spec\/Overview.html\">HTML 5 standard<\/a> gains up in speed.<\/p>\n<p>2) XHTML 2.0 probably will never become a successor to XHTML 1.0. In fact, XHTML 2.0 probably will never exist <em>at all<\/em>.<\/p>\n<p>3) Quite a few prominent Web designers and CSS\/HTML coders are abandoning XHTML 1.0 and go back to HTML 4.01 <em>(some of them even <a href=\"http:\/\/adactio.com\/journal\/1540\">experiment<\/a> very seriously with HTML 5)<\/em>.<\/p>\n<p>What HTML standard for documents do <em>you<\/em> prefer? And am I the only one who (still) prefers XHTML 1.0 over HTML 4.01? :-)<\/p>\n<p>It followed the interesting discussion at <strong><a href=\"http:\/\/mezzoblue.com\/archives\/2009\/04\/20\/switched\/\">mezzoblue<\/a><\/strong> &#8212; I managed to read almost all of the comments there!<\/p>\n<p>But, sometimes, it is not very clear to me as to where &#038; why are going the Web Standards, guided by <a href=\"http:\/\/www.w3.org\/\">W3C<\/a>.<\/p>\n<p>After <strong>HTML 3.2<\/strong>, <strong>HTML 4.01<\/strong> came, then the <strong>XHTML 1.0<\/strong> standard was adopted, and now <strong>HTML 5<\/strong> is developed? There&#8217;s almost no logic behind the versioning; plus, we have first the HTML language (which, in turn, derived from <a href=\"http:\/\/en.wikipedia.org\/wiki\/SGML\">SGML<\/a>), then W3C decided that it would be a great idea to combine XML + HTML (and so, XHTML 1.0 was &#8216;born&#8217;), and finally, they turn back to the idea of &#8216;pure&#8217; HTML, and in the new standard <em>(HTML 5)<\/em>, the &#8216;X&#8217; is missing&#8230;<\/p>\n<p><!--more--><\/p>\n<p>What&#8217;s up next? I don&#8217;t know.<\/p>\n<p>Personally, I am a bit puzzled by the fact that the first standards, which I&#8217;ve learned, when I started doing Web design, were HTML 3.2 and HTML 4.01, then came XHTML 1.0 (&#8220;The Next Best Thing Since Sliced Bread&#8221;, after HTML 4.01) &#8212; at this time I had to learn how to close tags, which you don&#8217;t have to close at all (such as <code>img<\/code> and <code>br<\/code>, for example)&#8230; And now, after XHTML 1.0, it&#8217;s HTML&#8217;s turn again?<\/p>\n<p>For now, I don&#8217;t plan to change my coding style. XHTML 1.0 Transitional &#038; Strict are doing a great job.<\/p>\n<p>Besides, using HTML 4.01 has certain drawbacks (compared to XHTML 1.0):<\/p>\n<p>For example, under HTML 4.01, the closing of some tags is not obligatory at all &#8212; <code>&lt;p&gt;, &lt;li&gt;<\/code> can be opened, but you don&#8217;t have to close them after that, so the following two examples are both valid:<\/p>\n<p><em>example 1:<\/em><\/p>\n<pre><code>&lt;ul&gt;\r\n  &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Lorem&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Ipsum&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Dolor Sit&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n\r\n&lt;p&gt;Lorem ipsum...&lt;\/p&gt;\r\n\r\n&lt;p&gt;Lorem ipsum!&lt;\/p&gt;<\/code><\/pre>\n<p><em>example 2:<\/em><\/p>\n<pre><code>&lt;ul&gt;\r\n  &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Lorem&lt;\/a&gt;\r\n  &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Ipsum&lt;\/a&gt;\r\n  &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Dolor Sit&lt;\/a&gt;\r\n&lt;\/ul&gt;\r\n\r\n&lt;p&gt;Lorem ipsum...\r\n\r\n&lt;p&gt;Lorem ipsum!<\/code><\/pre>\n<p>This could lead to the situation, when the following example will be perfectly valid for the <a href=\"http:\/\/validator.w3.org\">W3C validator<\/a>:<\/p>\n<p><em>example 3:<\/em><\/p>\n<pre><code>&lt;ul&gt;\r\n  &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Lorem&lt;\/a&gt;\r\n  &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Ipsum&lt;\/a&gt;&lt;\/li&gt;\r\n  &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Dolor Sit&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n\r\n&lt;p&gt;Lorem ipsum...\r\n\r\n&lt;p&gt;Lorem ipsum!&lt;\/p&gt;<\/code><\/pre>\n<p>&#8230;but it will not look very well as code.<\/p>\n<p>Under XHTML 1.0, there is no such problem. Only <em>example 1<\/em> will be valid, when all opened tags are correctly closed. Such code is easier to be checked for any accidental mistakes, and it can be also read much easier by a machine.<\/p>\n<p>Also, you don&#8217;t have to use quotes for HTML attributes under HTML 4.01.<\/p>\n<p><em>example 4:<\/em><\/p>\n<pre><code>&lt;div class=container&gt;\r\n  &lt;p&gt;Lorem Ipsum...&lt;\/p&gt;\r\n  &lt;p class=&quot;blue&quot;&gt;Dolor sit...&lt;\/p&gt;\r\n&lt;\/div&gt;<\/code><\/pre>\n<p>Code like this will be valid for HTML 4.01, but not for XHTML 1.0. Under XHTML 1.0 only the following example will validate (when attributes are quoted):<\/p>\n<p><em>example 5:<\/em><\/p>\n<pre><code>&lt;div class=&quot;container&quot;&gt;\r\n  &lt;p&gt;Lorem Ipsum...&lt;\/p&gt;\r\n  &lt;p class=&quot;blue&quot;&gt;Dolor sit...&lt;\/p&gt;\r\n&lt;\/div&gt;<\/code><\/pre>\n<p>There are some more differences with HTML 4.01. Special characters like &#8216;<strong>&#038;<\/strong>&#8216;, &quot; (quotes), etc., are not necessarily encoded (under XHTML 1.0, the ampersand sign (&#038;) should be encoded as <code>&amp;amp;<\/code>, for example).<\/p>\n<p>Let&#8217;s not forget also that most of today&#8217;s CMS systems are programmed with XHTML 1.0 in mind (and not HTML 4.01), and if you use HTML in such a situation, it&#8217;s possible that you&#8217;ll end up with some &#8216;code mix&#8217; &#8212; HTML &#038; XHTML together in one page; in such a case, you&#8217;ll have to modify the way in which the particular CMS is working, or the code won&#8217;t validate at all&#8230;<\/p>\n<p>* * *<\/p>\n<p>If you are a good designer, you won&#8217;t have any problems using both HTML 4.01 and XHTML 1.0, without any noticeable difference. But even if you have a lot of experience in this area, using HTML 4 might hide certain caveats &#8212; it is much easier to allow certain types of mistakes, which <a href=\"http:\/\/validator.w3.org\">the validator<\/a> won&#8217;t find at all <em>(such as opened, but not correctly closed tags, etc.)<\/em>. From there to ending up with some kind of a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Tag_soup\">tag soup<\/a>, is just one small tiny step&#8230; On the other hand, XHTML 1.0 is much more strict in this aspect, and will learn you easier how to write well-formed (and well formatted) code.<\/p>\n<p>I am observing with much interest the development of HTML and CSS, but for now I did not hear any strong arguments so that XHTML 1.0 to be abandoned (in favour of HTML 4.01, for example). As to HTML 5, for now it is only a working draft, and it has a long road to go, before it becomes a mature and well-supported standard&#8230;<\/p>\n<p>I prefer to use some new features, present in CSS3, which modern browers already support (like <a href=\"http:\/\/www.google.com\/search?hl=en&#038;ei=iTMNSuKGJpTEsAaEutT-CA&#038;sa=X&#038;oi=spell&#038;resnum=0&#038;ct=result&#038;cd=1&#038;q=css3+rounded+corners&#038;spell=1\">CSS rounded corners<\/a> &#8212; Firefox and Safari have perfect support for them), than trying to start coding again in HTML style, without the &#8216;X&#8217;:-)<\/p>\n<p>I might be wrong, but I prefer the stricter way of coding, which XHTML 1.0 imposes&#8230; Just a simple habit?<\/p>\n<p>May be! :-)<\/p>\n<p><script src=\"http:\/\/digg.com\/tools\/diggthis.js\" type=\"text\/javascript\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are a professional Web designer and create HTML\/CSS code by hand for living, then you might be interested in the fact that Dave Shea switched from XHTML 1.0 to HTML 4.01. It&#8217;s a fact that: 1) Lately, the HTML 5 standard gains up in speed. 2) XHTML 2.0 probably will never become a&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,16],"tags":[],"class_list":["post-320","post","type-post","status-publish","format-standard","hentry","category-css","category-webdesign"],"_links":{"self":[{"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/posts\/320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/comments?post=320"}],"version-history":[{"count":3,"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/posts\/320\/revisions"}],"predecessor-version":[{"id":328,"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/posts\/320\/revisions\/328"}],"wp:attachment":[{"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/media?parent=320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/categories?post=320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.optimiced.com\/en\/wp-json\/wp\/v2\/tags?post=320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}