Archive for the ‘Elements’ Category

The details and summary elements

How often have you had to write some JavaScript to create an interactive widget that shows and hides some content? You might’ve even downloaded a whole JavaScript library to achieve such an effect. Well, it’s time to rejoice! HTML5 provides a way to create this toggle feature with just a few lines of HTML and no JavaScript in sight. And so we introduce to you the details element.

Avoiding common HTML5 mistakes

Between curating sites for the HTML5 gallery and answering readers’ questions here at HTML5 Doctor, I see a host of HTML5 sites and their underlying markup. In this post, I’ll show you some of the mistakes and poor markup practices I often see and explain how to avoid them.

Quoting and citing with <blockquote>, <q>, <cite>, and the cite attribute

Given HTML’s roots in the academic world, it should be no surprise that quoting is well-accomodated in the elements blockquote and q, with their optional cite attribute. In addition, there’s the cite element, which over the last nine years went from ‘semantic orphan element made good’ to one of the more contentious elements in HTML5. Let’s power up the endoscope and examine the scarring, starting with blockquote.

The hgroup hokey cokey

As you may well have heard this week, hgroup has been in, out and in the spec again, while members of the W3C and others have truly been shaking it all about. If you’ve missed this latest merry dance then please head on over to the W3 bug report page to help get a clearer indication.

HTML5 and Search Engine Optimisation (SEO)

Through our handy Ask The Doctor service, we get a lot of e-mails asking us about HTML5′s effect on Search Engine Optimisation (SEO). While we can’t answer in great detail (Messrs Google, Yahoo, Bing, and their friends haven’t sent us in-depth details of their algorithms), we’ve rounded up some useful facts from Google, the world’s most dominant search engine.

HTML5 Simplequiz 5: URLs of commenters

Here’s nice and simple Simplquiz for Christmas. Imagine a new site, with a news item in an <article> element. Within that are several user-submitted comments, each of which is in its own <article> element, as the spec recommends. Most commenting systems ask the commenter for his/ her URL, which is published in the header of the comment, usually as a link with the commenter’s name as the linked text.

The abbr element

The <abbr> element is not new to HTML5, nor has it been redefined. The HTML5 spec has, however, removed the <acronym> element, which was (and is) common in HTML 4 web pages. Simply put, instead of using <acronym>, use <abbr>.

video + canvas = magic

You’ve already learned about the <video> and <canvas> elements, but did you know that they were designed to be used together? In fact, the two elements are absolutely wondrous when you combine them together. I’m going to show off a few super-simple demos using the two elements together, which should help suggest cool future projects for you fellow web authors.