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: html5 kbd pre code samp
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…
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 :)