HTML 5?!

16 and

While considering something else, I checked syntax, and to my surprise, the <time> tag wasn’t even accepted! That was in HTML 4.01, so I switched the validator to HTML5 to see if it was allowed there. And it was. Is <time … that new? It seems there has been quite some controversy and unclarity about it: Stack Overflow, w3.org, HTML5 Doctor.

There was also a familiar error message, which vanished when switching from HTML 4.01 to HTML5: that about target=. I always ignored those errors, because I feel like I really need target. Of course it has the smell of frames to it, and long ago, I did use it for that. But the frames are gone, and target stayed.

I often offer hyperlinks that enable the reader to find more background info, IF they want to read it, but with the freedom to ignore it and read on in the linking document. Even if the link is clicked, I want the original text to remain available in its own browser tab. The new text should not appear in a new tab every time it’s clicked, as is the case when specifying target=_blank. Instead, I use consistent and unique labels per site or type of site, like Wikipedia, Wiktionary, Youtube, Stackoverflow, and my own rudhar.com.

I remember having considered a switch to what I thought was HTML5, but I postponed or rejected it because then I would have to replace any <br> still used (there aren’t many) by <br/> or <br />. I find that ugly nonsense. The semantics of a line break make it obvious that the tag just occurs, and does not need to be closed. Indicating that closure may be convenient for a parser builder, but it is useless and confusing for the coder and reader, and that should take precedence.

Also, I thought HTML5 was case-sensitive. I used to use a lot of uppercase tags, most of which I later replaced by lowercase when I preferred that for newer coding. But some is still left. Extra work.

And I would have to close all paragraphs by a </p> before the new <p>. I often leave that implicit: paragraphs cannot be nested, so when a new one starts, it is obvious that the previous one has ended, even without explicitly tagging that end.

In hindsight, I must have confused HTML5 with XHTML. In HTML5, <br> is fine, <p> may be closed but doesn’t need to, and <P> and <p> are equivalent. Exactly the way I like it.

A change I also find mildly amusing, is that an explicit <style> in the HTML head no longer requires a type. The earlier validator insisted on it, and explained:

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

But now they finally admit that this is superfluous, because what else than CSS text could a style be specified in? A Word document? A JPG image? An MP3 sound clip? Less is more, and small is beautiful. KISS.

The document header is much simpler now too. We used to have things like:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang=en>

and now it can be replaced by the much neater:
<!doctype html>
<html lang=en>

But then, why include a doctype in the first place? It’s simply html, suggesting HTML5 will be the holy grail forever and there will never be a HTML6. And I like that; why change or replace things every few years if they work fine?

doctype is html and that’s what the first tag says too, again. So there is no need for a doctype and we’re back in the olden days of HTML 3.2, or 2.0, or whatever it was when I started coding pages in 1997 or so, before 2002 anyway, when a HTML document started with <html> and ended with </html> and that was it. Clean, clear and simple.

But in HTML5, omitting the doctype is not allowed.

Anyway, I’m gonna change all my pages to HTML5 soon, gradually or maybe automated and abruptly. It’s better than HTML 4.01, and largely compatible.