LESSON 113 OF 120

Build: technical commands and output

Mark keyboard input with kbd and program output with samp.

Official sourceWHATWG HTML — kbd and sampReviewed: 2026-08-26
STEP 1 · LEARN

How it works

Mark keyboard input with kbd and program output with samp. Semantic structure should describe meaning, not visual appearance.

Correct example
<p>Press <kbd>Ctrl</kbd> + <kbd>S</kbd>. Result: <samp>Saved</samp>.</p>

kbd marks keys or other user input. samp marks text produced by a program. Keeping them distinct makes it clear who provides the input and who produces the result.

Common mistake
<p>Press <code>Ctrl + S</code>. Result: <code>Saved</code>.</p>

code only says that the text is code. It does not distinguish the user command from the program output.

STEP 2 · APPLY

Your exercise

Complete the example. Mark keyboard input with kbd and program output with samp.

STEP 3 · BUILD

Write and see the result

index.htmlHTML
Safe resultisolated
The draft stays only in this browser.HTML and CSS allowed · scripts and network blocked
STEP 4 · CHECK

What needs to pass

0%not checked
  • User input uses kbd.
  • Program output uses samp.
Explain the solution logic

Replace the first code with kbd and the second with samp; keep clear text inside both.