The <code> Element For Adding Code to Your Web Pages

The following line appears inside a <code> element.

<h1>This is a primary heading</h1>

The <kbd> Element for Keyboard Instructions

To force quit an application in Windows, hold down the ctrl, alt and delete keys together.

The <var> Element for Programming Variables

The following line is written inside a <code> element, while user-name is written inside a <var> element.

document.write("user-name")

As you can see, the content of the <var> element is italicized.

The <samp> Element for Sample Program Output

The following line uses the <samp> element to indicate the output from a script or program.

This is the output from our test script.