# Keyboard Key

> Styles kbd elements as little physical keys for keyboard shortcuts in docs.

- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: kbd, keyboard, shortcut, docs, key
- Live preview: https://copy-css.com/snippets/keyboard-key
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<p class="shortcut">Press <kbd>Ctrl</kbd> + <kbd>K</kbd> to search</p>
```

## CSS

```css
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.2em 0.5em;
  border: 1px solid #d4d4d8;
  border-bottom-width: 3px;
  border-radius: 6px;
  background: #fafafa;
  color: #27272a;
  font: 600 0.85em/1.2 ui-monospace, monospace;
  text-align: center;
}
```

## Notes

- This CSS Keyboard Key is 12 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
