# Skip to Content Link

> A “Skip to content” link that stays hidden until a keyboard user tabs to it. The preview loops it so you can see it.

- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: skip link, accessibility, a11y, keyboard, focus, wcag
- Live preview: https://copy-css.com/snippets/skip-link
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<a class="skip-link" href="#main">Skip to content</a>
```

## CSS

```css
/* Put it first inside <body>, and give your main content id="main" */
.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font: 600 14px system-ui, sans-serif;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: none;
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}
```

## Notes

- This CSS Skip to Content Link is 21 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses transitions and transforms.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
