# Ghost Button

> A transparent ghost button that takes its border and hover tint from currentColor, so it suits any background.

- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: transparent, secondary, hero, currentcolor, subtle
- Live preview: https://copy-css.com/snippets/ghost-button
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<button class="btn-ghost">Learn more</button>
```

## CSS

```css
.btn-ghost {
  padding: 13px 30px;
  border: 1.5px solid color-mix(in srgb, currentColor 40%, transparent);
  border-radius: 10px;
  background: transparent;
  color: #f8fafc;
  font: 600 16px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-ghost:hover {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.btn-ghost:active {
  background: color-mix(in srgb, currentColor 18%, transparent);
}

.btn-ghost:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
```

## Notes

- This CSS Ghost Button is 24 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
