2.6 Markup for technical explanations

LearnPress version: 1.5

Last modified: 26 March 2007

This section explains the use of code, kbd, and samp for markup of user input, web output, and markup.

Contents

  1. code
  2. kbd
  3. samp

Each of these elements is for inline content only.

code

Refers to computer code or, as used in this manual, HTML markup.

<code>This is code.</code>

kbd

Refers to keyboard input. Useful in marking up user input, as in a search field. May also be used to mark the text of a link to be clicked by the user, the name of a menu to be selected, etc.

When you are finished, click <kbd>submit</kbd> to submit the form.

hen you are finished, click submit to submit the form.

Note: This may not be a strictly permissible semantic use of the <kbd> element, but it’s awfully close.

samp

Refers to sample output of a computer program or, as used on LEARN NC, of the website itself. Used in conjunction with <kbd>. Use for marking up text that is either a prompt for user input or is a direct (and brief) response to user input.

If you do it right, you will see a message that says <samp>Congratulations!</samp>.

If you do it right, you will see a message that says Congratulations!