HTML5 HTML text semantics granularity at paulcarvill.com, the home of Paul Carvill on the web

link: paulcarvill at flickr

paulcarvill.com

Hi, I'm Paul Carvill and I'm a web developer. I am Head of Interface Development at LBi, Europe's largest digital agency.

I also like walking, cooking, Bollywood and rock 'n' roll.

HTML5 HTML text semantics granularity

posted: Thursday, June 18th, 2009 at 1:55 pm

Wow, HTML5 HTML semantic text description options are so granular I had to spend several minutes pondering whether my previous code snippet about relaxing Apache permissions warranted <code>, <kbd>, or <samp> elements, or a combination of all three.

In the end I settled on a <kbd> element for the bit I want you to type in (opening a file in vi from the command line), as that’s the bit you’re going to type. For the contents of the file I chose a <samp> element, as the text shown in the file is a sample of the output of my file, rather than a chunk of code you need to enter.

The difference between <code> and <samp> is very small, but it’s great that we actually now have this level of specificity, which should help ensure that HTML5 HTML is robust enough to last well into the future.

Tags:

2 Responses to “HTML5 HTML text semantics granularity”

  1. paul haine says:

    Those elements aren’t new to HTML 5, they’ve been around since at least HTML 4:

    http://www.w3.org/TR/html401/struct/text.html#h-9.2.1

    For completeness you should have snuck a few vars in there as well, and wrapped the link to Damon Parker’s website in a cite, perhaps…

  2. paul.carvill says:

    You’re right, Paul! It’s been a while since I read through any HTML4 documentation.

    I have, of course, updated this post using the HTML4 versioning elements del and ins :)