Don't use spans or code for shortcuts and keystrokes

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateUI13 min

About this video

Kevin Powell explains the HTML kbd and samp elements for marking up keyboard input and sample output, and shows how to style them differently depending on how they are nested. The video is aimed at developers and front-end builders who already write HTML and CSS.

What you’ll learn

  • Mark up keyboard shortcuts and sample output with the kbd and samp elements
  • Style nested kbd and samp elements using CSS selectors