Abbreviations, dates, and keyboard input
HTML Living Standard
Choose elements that identify what a piece of text means. Here you will mark an abbreviation, a calendar date, and keyboard input.
On this page
Mark up an abbreviation and a date
Spell out an abbreviation the first time readers see it. The abbr element marks the short form. The time element displays readable text while datetime gives software a standard date.
<p>The HyperText Markup Language (<abbr>HTML</abbr>) workshop starts on
<time datetime="2026-12-05">December 5, 2026</time>.
</p>
What to expect The readable date appears in the browser. Inspect the time element to see the value 2026-12-05.
Distinguish keyboard input from program output
Use kbd for input the user types or presses, samp for a program’s output, and code for a piece of source code.
<p>Press <kbd>Ctrl</kbd> + <kbd>Enter</kbd> to run <code>print("Ready")</code>.</p>
<p>The program displays <samp>Ready</samp>.</p>
What to expect This HTML displays the instructions and sample output. The shortcut is part of the example text.