Anne van Kesteren

Using HTML5: remove and replace

I’ve been using HTML5 for a year now or so on the archived pages for individual blog posts. It doesn’t mean much, I use <!doctype html> and make use of some of the new form controls. I’m now using the new DOCTYPE everywhere. I also took the time to remove all type="application/javascript" and type="text/javascript" attributes from script elements in my various templates. The search control I have now uses type="search". I replaced required="required" with required="" (I know). I haven’t done much else as that would mean adding more markup, e.g. a header and various article elements. I’m not using any div elements currently and the document outline for my weblog should be fine per HTML5 so I decided to not add any bloat (yet).

I also wrapped label elements around form controls rather than using for/id. Less clutter, less potential for duplicate IDs. Renamed IRI to URL in the comment form; standards suck. And finally, I dropped the RSS feed in favor of Atom. If someone can increase the acceptance of rel="feed" in user agents that would be much appreciated as it would save me thirty-three characters on several pages. No, I don’t have Google’s bandwidth bill, but readability counts.

Comments

  1. What's the point of all the minimalism? Those young ones... CSS will completely break in Netscape 4 with all those unclosed P and LI elements!

    Posted by Rijk at

  2. I replaced required="required" with required=""

    Why not just required?

    Posted by Marc Görtz at

  3. I replaced required="required" with required=""
    Why not just required?

    Because unquoted attributes aren't allowed in HTML 4 or 5.
    Anne, is the reason for not having something more logical like required="true" for backwards compatibility reasons?

    Posted by IceArdor at

  4. Unquoted attributes are allowed in both HTML4 and HTML5. They are just less readable in my opinion. The syntax for the required attribute is consistent with e.g. the readonly syntax. We think it makes sense to do boolean attributes in the same way in HTML5.

    Posted by Anne van Kesteren at

  5. "I also wrapped label elements around form controls rather than using for/id. Less clutter, less potential for duplicate IDs."

    You may not care, but so you know, JAWS will read the first label of a group of radios or checkboxes without the for attribute. Every radio's label, even wrapped, will be read out as the first one. So a yes/no question becomes "Yes" "Yes".

    Posted by Stomme poes at