html kbd tag tips

Perm url with updates: http://xahlee.org/js/blog.html

Discovered the “<kbd>” tag. It's similar to the “i”, “b”, “strong”, tags, but for keyboard input. It is also supported in html5. I now used it to markup keyboard keys, e.g. “Ctrl+x”.

I used to use:

<span class="key">Ctrl</span>

But that's more verbose. Now i use emacs to make the change on about 100 files on my site. (See: Emacs Interactively Find and Replace String Patterns on Multiple Files)

The css i use is this:

kbd {border:solid 1px #c2c2c2;background-color:#f0f0f0;
padding-left:.3ex;padding-right:.3ex;font-family:monospace}

Popular posts from this blog

11 Years of Writing About Emacs

does md5 creates more randomness?

Google Code shutting down, future of ErgoEmacs