views:

75

answers:

2

I keep making attempts at properly using HTML5 but I feel like it's still not even close to anything semantically valuable.

My attempts:

But there's such subtleties in every single tag!

My question is, what specific software out there on the web is actually doing things like processing our HTML DOM, calculating and comparing elements to say "oh, this is a <header>, and it's just after <section>, and it has <time> in it, so the <time> tag must be "metadata" in relation to the <header>...", and saying "The content within the <time> tag not only is the "published time", but also relates to the author's birthday, so it must be a special post (say because there was also a <cite> or <address class='vcard'> tag in there too)".

I mean, what benefit am I ever going to get in using HTML5 if I don't know the algorithms that are interpreting it? If I just stuck with the basic div, ol, ul, li, p, a, h[1-6] tags, I could do everything with half the number of DOM elements.

Looking forward to some specific algorithms that I can use to shape how I structure the DOM from here on out.

I'm at the point where I don't even think we should be using HTML5 tags at all. For example, on the iPhone especially, the goal should be to minimize dom elements to decrease load time. Plus, if the iPhone site is a mirror of the traditional browser version, the search engines won't even see the iPhone site (ideally). So there's no real point in making the DOM semantic. So if I can use 1/2 the amount of <div> tags to achieve the same layout as if I used a somewhat "semantic HTML5" rendition, and that's a good thing for the iPhone, why don't I do that for the regular browser too? That's where I'm coming from.

Articles like this are basically saying it's pointless to worry about semantic HTML.

+1  A: 

Search engines can/will better interpret your pages which combined with other factors will result in better rankings for your pages.

Moreover if you use the tags consistently and semantically, you could build your own reusable widgets and libraries that derive knowledge from the HTML structure independent of how the data is stored in the backend.

alt text

Consider this sample Google search where you can filter results by date. By using semantic HTML, for let's say, <article> and <time>, you can write a simple crawler that recreates this functionality or allows users to specify a timespan within which to search articles in your own site(s).

Anurag
+1  A: 

What algorithms are reading your semantic HTML? Google, that's who. Their algorithm tries to extract every bit of meaning from pages that it can, because that helps Google construct smart, relevant search results. For one example, Google tries to determine the dates of things by reading the HTML and gives headers extra consideration in determining the overall topic of a page.

Also, your assertion that we shouldn't use HTML5 tags on the iPhone "to minimize dom elements" isn't founded in any technical basis. HTML5 doesn't dictate that we use more DOM elements, and in fact it can let us leave out tags that would be required by XHTML. You should use HTML5 on the iPhone more than anywhere else. For example, the new input types like number and email don't do much on the desktop, but that extra information can really make things nicer on the iPhone by allowing it to present an appropriate interface.

Chuck
"in fact it can let us leave out tags that would be required by XHTML", examples?
viatropos
@viatropos: Specifically, HTML5 has inherent self-closing tags, whereas any XML serialization requires either a closing tag or a self-closing tag. So, for example, `<li>` can stand alone in HTML5, whereas in XHTML it requires a closing `</li>` — ditto for things like `<p>`. And `<link>` needs to be `<link/>` in XHTML, and `<img>` needs to be `<img/>` and so on. I just find it weird to say that HTML5 somehow makes the Web *more* verbose than it already is.
Chuck