# copy CSS: full snippet library
> 428 free UI snippets in plain HTML and CSS. Free for personal and commercial use. No signup, no attribution required. Index: https://copy-css.com/llms.txt
# CSS Buttons
Hover effects, 3D presses and gradient buttons you can drop into any project.
## Glow Button
> A gradient call-to-action button with a soft colored glow that lifts on hover.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: gradient, hover, shadow, cta
- Live preview: https://copy-css.com/snippets/glow-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-glow {
padding: 14px 32px;
border: 0;
border-radius: 12px;
font: 600 16px/1 system-ui, sans-serif;
color: #fff;
background: linear-gradient(135deg, #6366f1, #a855f7);
box-shadow: 0 10px 24px -8px rgba(139, 92, 246, 0.7);
cursor: pointer;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-glow:hover {
transform: translateY(-2px);
box-shadow: 0 16px 32px -8px rgba(139, 92, 246, 0.85);
}
.btn-glow:active {
transform: translateY(0);
}
```
### Notes
- This CSS Glow Button is 20 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions, transforms, linear gradients and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Fill on Hover Button
> An outlined pill button that fills with color from left to right on hover.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: outline, hover, pill, animation
- Live preview: https://copy-css.com/snippets/fill-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-fill {
position: relative;
z-index: 0;
overflow: hidden;
padding: 14px 32px;
border: 2px solid #0284c7;
border-radius: 999px;
background: transparent;
color: #0284c7;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
transition: color 0.3s ease;
}
.btn-fill::before {
content: "";
position: absolute;
inset: 0;
z-index: -1;
background: #0284c7;
transform: scaleX(0);
transform-origin: left;
transition: transform 0.3s ease;
}
.btn-fill:hover {
color: #fff;
}
.btn-fill:hover::before {
transform: scaleX(1);
}
```
### Notes
- This CSS Fill on Hover Button is 32 lines of pure CSS (0.6 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.
## 3D Push Button
> A chunky, tactile button that physically sinks down when you press it.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: 3d, active, press, click
- Live preview: https://copy-css.com/snippets/pushable-3d-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-3d {
padding: 14px 32px;
border: 0;
border-radius: 12px;
background: #f43f5e;
color: #fff;
font: 700 16px/1 system-ui, sans-serif;
box-shadow: 0 6px 0 #be123c;
cursor: pointer;
transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-3d:hover {
filter: brightness(1.05);
}
.btn-3d:active {
transform: translateY(6px);
box-shadow: 0 0 0 #be123c;
}
```
### Notes
- This CSS 3D Push Button is 20 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and filters.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Neo-Brutalist Button
> A bold neo-brutalist button with a thick border and a hard offset shadow.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: brutalism, retro, bold, offset shadow
- Live preview: https://copy-css.com/snippets/brutalist-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-brutal {
padding: 14px 28px;
border: 3px solid #111;
background: #facc15;
color: #111;
font: 800 16px/1 system-ui, sans-serif;
box-shadow: 5px 5px 0 #111;
cursor: pointer;
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-brutal:hover {
transform: translate(-2px, -2px);
box-shadow: 7px 7px 0 #111;
}
.btn-brutal:active {
transform: translate(5px, 5px);
box-shadow: 0 0 0 #111;
}
```
### Notes
- This CSS Neo-Brutalist Button is 20 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses transitions, transforms and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Shine Sweep Button
> A dark button with a light streak that sweeps across it on a loop.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: shine, shimmer, dark, animation
- Live preview: https://copy-css.com/snippets/shine-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-shine {
position: relative;
overflow: hidden;
padding: 14px 32px;
border: 0;
border-radius: 10px;
background: #111827;
color: #fff;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
}
.btn-shine::after {
content: "";
position: absolute;
top: 0;
left: -75%;
width: 50%;
height: 100%;
background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
transform: skewX(-20deg);
animation: shine 2.8s ease-in-out infinite;
}
@keyframes shine {
60%, 100% { left: 125%; }
}
@media (prefers-reduced-motion: reduce) {
.btn-shine::after {
animation: none;
}
}
```
### Notes
- This CSS Shine Sweep Button is 33 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, linear gradients and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Gradient Border Button
> A clean button with a multi-color gradient border, no extra elements needed.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: gradient, border, outline
- Live preview: https://copy-css.com/snippets/gradient-border-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-gradient-border {
padding: 14px 32px;
border: 2px solid transparent;
border-radius: 12px;
background:
linear-gradient(#fff, #fff) padding-box,
linear-gradient(90deg, #f97316, #ec4899, #8b5cf6) border-box;
color: #111;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
transition: transform 0.2s ease;
}
.btn-gradient-border:hover {
transform: translateY(-2px);
}
```
### Notes
- This CSS Gradient Border Button is 16 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses transitions, transforms and linear gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Arrow Slide Button
> A dark pill button whose arrow nudges forward on hover, inviting the next click.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: arrow, hover, pill, cta, dark
- Live preview: https://copy-css.com/snippets/arrow-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-arrow {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 14px 24px;
border: 0;
border-radius: 999px;
background: #111;
color: #fff;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
transition: background 0.2s ease;
}
.btn-arrow span {
transition: transform 0.25s ease;
}
.btn-arrow:hover {
background: #2a2a2a;
}
.btn-arrow:hover span {
transform: translateX(4px);
}
```
### Notes
- This CSS Arrow Slide Button is 25 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses transitions, transforms and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Pulsing CTA Button
> A call-to-action button that sends out a soft pulse to draw the eye.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: pulse, cta, attention, animation, green
- Live preview: https://copy-css.com/snippets/pulse-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-pulse {
padding: 14px 30px;
border: 0;
border-radius: 999px;
background: #16a34a;
color: #fff;
font: 700 16px/1 system-ui, sans-serif;
cursor: pointer;
animation: btn-pulse 2s infinite;
}
@keyframes btn-pulse {
0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); }
70% { box-shadow: 0 0 0 16px rgba(22, 163, 74, 0); }
100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
@media (prefers-reduced-motion: reduce) {
.btn-pulse {
animation: none;
}
}
```
### Notes
- This CSS Pulsing CTA Button is 22 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, box shadows and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Glass Button
> A frosted glass button for colorful hero sections and image backgrounds.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: glass, glassmorphism, blur, frosted, backdrop-filter
- Live preview: https://copy-css.com/snippets/glass-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-glass {
padding: 14px 32px;
border: 1px solid rgba(255, 255, 255, 0.45);
border-radius: 14px;
background: rgba(255, 255, 255, 0.18);
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.4);
color: #fff;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
transition: background 0.2s ease;
}
.btn-glass:hover {
background: rgba(255, 255, 255, 0.28);
}
```
### Notes
- This CSS Glass Button is 17 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions, box shadows and backdrop filters.
- backdrop filters: Includes the -webkit- prefix for older Safari.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Loading Button
> A button with a built-in spinner. Add the is-loading class while a request runs.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: loading, spinner, state, submit, form
- Live preview: https://copy-css.com/snippets/loading-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-loading {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 14px 26px;
border: 0;
border-radius: 12px;
background: #2563eb;
color: #fff;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
}
.btn-loading.is-loading {
cursor: progress;
opacity: 0.9;
}
.btn-loading.is-loading::before {
content: "";
width: 16px;
height: 16px;
border: 2.5px solid rgba(255, 255, 255, 0.4);
border-top-color: #fff;
border-radius: 50%;
animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin {
to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
.btn-loading.is-loading::before {
animation-duration: 2s;
}
}
```
### Notes
- This CSS Loading Button is 37 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, Flexbox and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Text Roll Button
> On hover the label rolls up and a colored copy rolls in from below.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: hover, text, slide, roll, outline
- Live preview: https://copy-css.com/snippets/text-roll-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-roll {
overflow: hidden;
padding: 14px 30px;
border: 2px solid #111;
border-radius: 10px;
background: #fff;
color: #111;
font: 700 16px/1 system-ui, sans-serif;
cursor: pointer;
}
.btn-roll span {
position: relative;
display: inline-block;
transition: transform 0.3s ease;
}
.btn-roll span::after {
content: attr(data-text);
position: absolute;
top: calc(100% + 20px);
left: 0;
color: #7c3aed;
}
.btn-roll:hover span {
transform: translateY(calc(-100% - 20px));
}
```
### Notes
- This CSS Text Roll Button is 28 lines of pure CSS (0.5 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.
## Corner Brackets Button
> A minimal button with corner brackets that slide out to frame it on hover.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: brackets, corners, hover, outline, minimal
- Live preview: https://copy-css.com/snippets/corner-brackets-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-brackets {
position: relative;
padding: 14px 30px;
border: 0;
background: transparent;
color: #1c1917;
font: 700 15px/1 system-ui, sans-serif;
letter-spacing: 0.08em;
text-transform: uppercase;
cursor: pointer;
}
.btn-brackets::before,
.btn-brackets::after {
content: "";
position: absolute;
width: 12px;
height: 12px;
border: 2px solid #ea580c;
transition: all 0.25s ease;
}
.btn-brackets::before {
top: 4px;
left: 4px;
border-right: 0;
border-bottom: 0;
}
.btn-brackets::after {
right: 4px;
bottom: 4px;
border-left: 0;
border-top: 0;
}
.btn-brackets:hover::before,
.btn-brackets:hover::after {
width: calc(100% - 8px);
height: calc(100% - 8px);
}
```
### Notes
- This CSS Corner Brackets Button is 41 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Split Button
> A primary action joined to a caret segment for extra options.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: split, dropdown, group, caret, actions
- Live preview: https://copy-css.com/snippets/split-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-split {
display: inline-flex;
border-radius: 10px;
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}
.btn-split button {
display: inline-grid;
place-items: center;
padding: 12px 18px;
border: 0;
background: #0f766e;
color: #fff;
font: 600 15px/1 system-ui, sans-serif;
cursor: pointer;
transition: background 0.15s ease;
}
.btn-split button:first-child {
border-radius: 10px 0 0 10px;
}
.btn-split button:last-child {
padding-inline: 12px;
border-left: 1px solid rgba(255, 255, 255, 0.28);
border-radius: 0 10px 10px 0;
}
.btn-split button:hover {
background: #115e59;
}
.btn-split button:focus-visible {
position: relative;
outline: 2px solid #0f766e;
outline-offset: 2px;
}
```
### Notes
- This CSS Split Button is 37 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, box shadows, CSS Grid and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Offset Frame Button
> A solid button with an offset outline frame that snaps into place on hover.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: offset, frame, border, hover, editorial
- Live preview: https://copy-css.com/snippets/offset-frame-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-frame {
position: relative;
padding: 14px 30px;
border: 0;
background: #86198f;
color: #fff;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
}
.btn-frame::after {
content: "";
position: absolute;
inset: 0;
border: 2px solid #86198f;
transform: translate(7px, 7px);
transition: transform 0.2s ease;
pointer-events: none;
}
.btn-frame:hover::after {
transform: translate(0, 0);
}
```
### Notes
- This CSS Offset Frame Button is 23 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.
## Neon Button
> An outlined neon button that glows softly and lights up fully on hover.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: neon, glow, outline, dark, cyberpunk, hover
- Live preview: https://copy-css.com/snippets/neon-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-neon {
padding: 14px 34px;
border: 2px solid #22d3ee;
border-radius: 10px;
background: transparent;
color: #a5f3fc;
font: 700 15px/1 system-ui, sans-serif;
letter-spacing: 0.12em;
text-transform: uppercase;
text-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
box-shadow:
0 0 12px rgba(34, 211, 238, 0.45),
inset 0 0 12px rgba(34, 211, 238, 0.35);
cursor: pointer;
transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.btn-neon:hover {
background: #22d3ee;
color: #083344;
text-shadow: none;
box-shadow:
0 0 24px rgba(34, 211, 238, 0.9),
0 0 64px rgba(34, 211, 238, 0.5);
}
.btn-neon:focus-visible {
outline: 2px solid #a5f3fc;
outline-offset: 4px;
}
```
### Notes
- This CSS Neon Button is 30 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, box shadows, text shadows and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Ripple Button
> A Material-style ripple that spreads from the center when you click. Pure CSS, no JavaScript.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: ripple, material, click, press, feedback
- Live preview: https://copy-css.com/snippets/ripple-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-ripple {
--c: #7c3aed;
padding: 14px 32px;
border: 0;
border-radius: 10px;
color: #fff;
font: 600 16px/1 system-ui, sans-serif;
background: var(--c) radial-gradient(circle, transparent 1%, var(--c) 1%) center / 15000%;
box-shadow: 0 6px 16px -6px rgba(124, 58, 237, 0.6);
cursor: pointer;
transition: background 0.8s;
}
.btn-ripple:hover {
--c: #6d28d9;
}
/* The ripple: shrink the gradient instantly, then let it grow back */
.btn-ripple:active {
background-color: #c4b5fd;
background-size: 100%;
transition: background 0s;
}
.btn-ripple:focus-visible {
outline: 2px solid #7c3aed;
outline-offset: 3px;
}
```
### Notes
- This CSS Ripple Button is 28 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, radial gradients, box shadows and keyboard focus styles.
- Customize with: `--c`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Draw Border Button
> A border that draws itself around the button, one side after another, on hover.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: border, draw, outline, hover, animation, line
- Live preview: https://copy-css.com/snippets/draw-border-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-draw {
position: relative;
padding: 14px 32px;
border: 0;
background: transparent;
box-shadow: inset 0 0 0 2px #e2e8f0;
color: #0f172a;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
}
.btn-draw::before,
.btn-draw::after {
content: "";
position: absolute;
box-sizing: border-box;
width: 0;
height: 0;
border: 2px solid transparent;
}
.btn-draw::before {
top: 0;
left: 0;
}
.btn-draw::after {
right: 0;
bottom: 0;
}
.btn-draw:hover::before,
.btn-draw:hover::after,
.btn-draw:focus-visible::before,
.btn-draw:focus-visible::after {
width: 100%;
height: 100%;
}
/* Top, then right... */
.btn-draw:hover::before,
.btn-draw:focus-visible::before {
border-top-color: #6366f1;
border-right-color: #6366f1;
transition: width 0.2s ease-out, height 0.2s ease-out 0.2s;
}
/* ...then bottom, then left */
.btn-draw:hover::after,
.btn-draw:focus-visible::after {
border-bottom-color: #6366f1;
border-left-color: #6366f1;
transition: border-color 0s 0.4s, width 0.2s ease-out 0.4s, height 0.2s ease-out 0.6s;
}
.btn-draw:focus-visible {
outline: none;
}
```
### Notes
- This CSS Draw Border Button is 58 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses transitions, box shadows and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Clay Button
> A puffy claymorphism button made from inner highlights, inner shade and a soft drop shadow.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: claymorphism, clay, 3d, soft, puffy, inset
- Live preview: https://copy-css.com/snippets/clay-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-clay {
padding: 16px 34px;
border: 0;
border-radius: 20px;
background: #a78bfa;
color: #fff;
font: 700 16px/1 system-ui, sans-serif;
text-shadow: 0 1px 1px rgba(76, 29, 149, 0.4);
box-shadow:
inset 0 -6px 10px rgba(76, 29, 149, 0.35),
inset 0 6px 10px rgba(255, 255, 255, 0.45),
0 12px 24px -8px rgba(124, 58, 237, 0.55);
cursor: pointer;
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-clay:hover {
transform: translateY(-2px);
box-shadow:
inset 0 -6px 10px rgba(76, 29, 149, 0.35),
inset 0 6px 10px rgba(255, 255, 255, 0.45),
0 16px 30px -8px rgba(124, 58, 237, 0.6);
}
.btn-clay:active {
transform: translateY(1px) scale(0.98);
box-shadow:
inset 0 -3px 8px rgba(76, 29, 149, 0.35),
inset 0 4px 8px rgba(255, 255, 255, 0.4),
0 6px 12px -6px rgba(124, 58, 237, 0.5);
}
.btn-clay:focus-visible {
outline: 2px solid #7c3aed;
outline-offset: 3px;
}
```
### Notes
- This CSS Clay Button is 36 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and text shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Animated Gradient Button
> A pill button whose multi-color gradient drifts slowly and speeds up when you hover it.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: moving, background-position, colorful, cta, hover
- Live preview: https://copy-css.com/snippets/animated-gradient-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-shift {
padding: 14px 32px;
border: 0;
border-radius: 999px;
background: linear-gradient(90deg, #c2410c, #db2777, #7c3aed, #c2410c);
background-size: 300% 100%;
color: #fff;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
animation: btn-shift-move 8s linear infinite;
}
.btn-shift:hover {
animation-duration: 2.5s;
}
.btn-shift:focus-visible {
outline: 3px solid #7c3aed;
outline-offset: 3px;
}
@keyframes btn-shift-move {
to { background-position: 300% 0; }
}
@media (prefers-reduced-motion: reduce) {
.btn-shift { animation: none; }
}
```
### Notes
- This CSS Animated Gradient Button is 28 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients, keyboard focus styles and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Jelly Button
> A playful button that squashes and stretches like jelly when hovered or focused.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: squish, elastic, bounce, playful, hover
- Live preview: https://copy-css.com/snippets/jelly-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-jelly {
padding: 14px 34px;
border: 0;
border-radius: 16px;
background: #e11d48;
color: #fff;
font: 700 16px/1 system-ui, sans-serif;
cursor: pointer;
}
.btn-jelly:hover,
.btn-jelly:focus-visible {
animation: btn-jelly-squish 0.6s ease;
}
.btn-jelly:focus-visible {
outline: 3px solid #e11d48;
outline-offset: 4px;
}
@keyframes btn-jelly-squish {
0%, 100% { transform: scale(1, 1); }
25% { transform: scale(1.15, 0.85); }
50% { transform: scale(0.9, 1.1); }
75% { transform: scale(1.05, 0.95); }
}
@media (prefers-reduced-motion: reduce) {
.btn-jelly:hover,
.btn-jelly:focus-visible { animation: none; }
}
```
### Notes
- This CSS Jelly Button is 31 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, keyboard focus styles and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Skewed Button
> A sporty slanted button that straightens out and changes color on hover, with upright text.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: parallelogram, slanted, sporty, uppercase, hover
- Live preview: https://copy-css.com/snippets/skewed-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-skew {
position: relative;
isolation: isolate;
padding: 15px 36px;
border: 0;
background: transparent;
color: #fff;
font: 800 15px/1 system-ui, sans-serif;
letter-spacing: 0.08em;
text-transform: uppercase;
cursor: pointer;
}
/* Only the background is skewed, so the text stays upright */
.btn-skew::before {
content: "";
position: absolute;
inset: 0;
z-index: -1;
background: #0f172a;
transform: skewX(-16deg);
transition: transform 0.25s ease, background-color 0.25s ease;
}
.btn-skew:hover::before {
background: #2563eb;
transform: skewX(0);
}
.btn-skew:focus-visible {
outline: 3px solid #2563eb;
outline-offset: 4px;
}
```
### Notes
- This CSS Skewed Button is 33 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, transforms and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Circle Reveal Button
> An outlined button that fills with a circle growing out from its center on hover.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: clip-path, radial, expand, fill, hover
- Live preview: https://copy-css.com/snippets/circle-reveal-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-reveal {
position: relative;
isolation: isolate;
overflow: hidden;
padding: 14px 32px;
border: 2px solid #0f766e;
border-radius: 12px;
background: #fff;
color: #0f766e;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
transition: color 0.4s ease;
}
.btn-reveal::before {
content: "";
position: absolute;
inset: 0;
z-index: -1;
background: #0f766e;
clip-path: circle(0% at 50% 50%);
transition: clip-path 0.45s ease;
}
.btn-reveal:hover,
.btn-reveal:focus-visible {
color: #fff;
}
.btn-reveal:hover::before,
.btn-reveal:focus-visible::before {
clip-path: circle(100% at 50% 50%);
}
.btn-reveal:focus-visible {
outline: 3px solid #5eead4;
outline-offset: 3px;
}
```
### Notes
- This CSS Circle Reveal Button is 38 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, clip paths and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Stacked Layers Button
> A bold outlined button that fans out two colored layers behind it on hover, then snaps flat on click.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: offset, depth, playful, retro, box-shadow
- Live preview: https://copy-css.com/snippets/stacked-layers-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-stack {
padding: 14px 32px;
border: 2px solid #111827;
border-radius: 10px;
background: #fde047;
color: #111827;
font: 700 16px/1 system-ui, sans-serif;
cursor: pointer;
/* Each layer = a colored shadow inset by 2px over a dark one (the outline) */
box-shadow:
0 0 0 -2px #f472b6, 0 0 0 0 #111827,
0 0 0 -2px #60a5fa, 0 0 0 0 #111827;
transition: box-shadow 0.2s ease;
}
.btn-stack:hover,
.btn-stack:focus-visible {
box-shadow:
5px 5px 0 -2px #f472b6, 5px 5px 0 0 #111827,
10px 10px 0 -2px #60a5fa, 10px 10px 0 0 #111827;
}
.btn-stack:active {
box-shadow:
0 0 0 -2px #f472b6, 0 0 0 0 #111827,
0 0 0 -2px #60a5fa, 0 0 0 0 #111827;
}
.btn-stack:focus-visible {
outline: 3px solid #2563eb;
outline-offset: 14px;
}
```
### Notes
- This CSS Stacked Layers Button is 32 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, box shadows and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Spinning Border Button
> A dark button with a beam of light that travels around its border, the look used for AI features.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: conic-gradient, rotating, glow, dark, ai
- Live preview: https://copy-css.com/snippets/spinning-border-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-spin-border {
position: relative;
isolation: isolate;
overflow: hidden;
padding: 14px 34px;
border: 0;
border-radius: 12px;
background: #1e293b;
color: #e2e8f0;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
}
/* A large rotating conic gradient, clipped by the button */
.btn-spin-border::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
z-index: -2;
width: 200%;
aspect-ratio: 1;
background: conic-gradient(#0000 0 65%, #38bdf8, #a78bfa, #0000 95%);
transform: translate(-50%, -50%);
animation: btn-spin-border-rotate 3s linear infinite;
}
/* The inner fill covers everything except a 2px ring */
.btn-spin-border::after {
content: "";
position: absolute;
inset: 2px;
z-index: -1;
border-radius: 10px;
background: #0b1120;
}
.btn-spin-border:focus-visible {
outline: 2px solid #38bdf8;
outline-offset: 3px;
}
@keyframes btn-spin-border-rotate {
to { transform: translate(-50%, -50%) rotate(1turn); }
}
@media (prefers-reduced-motion: reduce) {
.btn-spin-border::before { animation: none; }
}
```
### Notes
- This CSS Spinning Border Button is 49 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, conic gradients and aspect-ratio.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## 3D Flip Button
> A button that flips over in 3D on hover to show a second label on its back face.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: rotate, perspective, cube, reveal, hover
- Live preview: https://copy-css.com/snippets/3d-flip-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-flip {
position: relative;
padding: 0;
border: 0;
border-radius: 12px;
background: none;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
perspective: 600px;
}
.btn-flip-front,
.btn-flip-back {
display: grid;
place-items: center;
padding: 15px 34px;
border-radius: 12px;
color: #fff;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
transition: transform 0.5s ease;
}
.btn-flip-front {
background: #4f46e5;
}
.btn-flip-back {
position: absolute;
inset: 0;
padding: 0;
background: #0f172a;
transform: rotateX(-180deg);
}
.btn-flip:hover .btn-flip-front,
.btn-flip:focus-visible .btn-flip-front {
transform: rotateX(180deg);
}
.btn-flip:hover .btn-flip-back,
.btn-flip:focus-visible .btn-flip-back {
transform: rotateX(0);
}
.btn-flip:focus-visible {
outline: 3px solid #4f46e5;
outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
.btn-flip-front,
.btn-flip-back { transition: none; }
}
```
### Notes
- This CSS 3D Flip Button is 54 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses transitions, 3D transforms, transforms and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Isometric Button
> An isometric block button with skewed side faces that pushes into the page when clicked.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: 3d, extrude, skew, depth, press
- Live preview: https://copy-css.com/snippets/isometric-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-iso {
--depth: 8px;
position: relative;
padding: 15px 34px;
border: 0;
background: #f59e0b;
color: #1c1917;
font: 800 16px/1 system-ui, sans-serif;
cursor: pointer;
transition: transform 0.12s ease;
}
/* Bottom face */
.btn-iso::before {
content: "";
position: absolute;
top: 100%;
left: 0;
width: 100%;
height: var(--depth);
background: #b45309;
transform: skewX(45deg);
transform-origin: top;
transition: height 0.12s ease;
}
/* Right face */
.btn-iso::after {
content: "";
position: absolute;
top: 0;
left: 100%;
width: var(--depth);
height: 100%;
background: #d97706;
transform: skewY(45deg);
transform-origin: left;
transition: width 0.12s ease;
}
.btn-iso:active {
transform: translate(var(--depth), var(--depth));
}
.btn-iso:active::before {
height: 0;
}
.btn-iso:active::after {
width: 0;
}
.btn-iso:focus-visible {
outline: 3px solid #1c1917;
outline-offset: 14px;
}
```
### Notes
- This CSS Isometric Button is 56 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, transforms, keyboard focus styles and custom properties.
- Customize with: `--depth`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Arcade Button
> A glossy round arcade button that sinks into its base when you press it.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: round, retro, game, glossy, press
- Live preview: https://copy-css.com/snippets/arcade-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-arcade {
width: 96px;
height: 96px;
border: 0;
border-radius: 50%;
background: radial-gradient(circle at 35% 30%, #f87171 0 12%, #dc2626 45%, #b91c1c 100%);
color: #fff;
font: 800 14px/1 system-ui, sans-serif;
letter-spacing: 0.12em;
text-transform: uppercase;
text-shadow: 0 1px 0 #7f1d1d;
box-shadow:
0 8px 0 #7f1d1d,
0 8px 0 6px #111827,
0 16px 20px 6px #00000080;
cursor: pointer;
transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn-arcade:active {
transform: translateY(6px);
box-shadow:
0 2px 0 #7f1d1d,
0 2px 0 6px #111827,
0 8px 12px 6px #00000080;
}
.btn-arcade:focus-visible {
outline: 3px solid #fde047;
outline-offset: 12px;
}
```
### Notes
- This CSS Arcade Button is 31 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, transforms, radial gradients and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Retro Bevel Button
> A classic Windows 95 style gray button with beveled edges that invert when pressed.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: windows 95, classic, inset, pixel, vintage
- Live preview: https://copy-css.com/snippets/retro-bevel-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-bevel {
min-width: 88px;
padding: 7px 20px;
border: 0;
border-radius: 0;
background: #c0c0c0;
color: #000;
font: 14px/1.2 Tahoma, "MS Sans Serif", Geneva, sans-serif;
box-shadow:
inset -1px -1px #0a0a0a,
inset 1px 1px #fff,
inset -2px -2px #808080,
inset 2px 2px #dfdfdf;
cursor: pointer;
}
.btn-bevel:active {
padding: 8px 19px 6px 21px;
box-shadow:
inset -1px -1px #fff,
inset 1px 1px #0a0a0a,
inset -2px -2px #dfdfdf,
inset 2px 2px #808080;
}
.btn-bevel:focus-visible {
outline: 1px dotted #000;
outline-offset: -5px;
}
```
### Notes
- This CSS Retro Bevel Button is 29 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses box shadows and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Glossy Button
> A shiny gel pill button with a glass highlight on top, inspired by early-2000s interfaces.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: aqua, gel, web 2.0, shiny, skeuomorphic
- Live preview: https://copy-css.com/snippets/glossy-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-glossy {
position: relative;
padding: 15px 40px;
border: 1px solid #1e40af;
border-radius: 999px;
background: linear-gradient(#3b82f6, #1d4ed8 60%, #1e40af);
color: #fff;
font: 700 16px/1 system-ui, sans-serif;
text-shadow: 0 -1px 0 #1e3a8a;
box-shadow:
inset 0 -3px 6px #60a5fa,
0 6px 12px -4px #1e40af;
cursor: pointer;
transition: filter 0.2s ease;
}
/* The glass highlight */
.btn-glossy::before {
content: "";
position: absolute;
top: 2px;
left: 10%;
right: 10%;
height: 42%;
border-radius: 999px;
background: linear-gradient(#ffffffb3, #ffffff14);
pointer-events: none;
}
.btn-glossy:hover {
filter: brightness(1.1) saturate(1.1);
}
.btn-glossy:active {
box-shadow:
inset 0 2px 6px #1e3a8a,
0 2px 6px -2px #1e40af;
}
.btn-glossy:focus-visible {
outline: 3px solid #1d4ed8;
outline-offset: 3px;
}
```
### Notes
- This CSS Glossy Button is 43 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, linear gradients, box shadows and text shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Round Icon Button
> Circular icon-only buttons in solid, soft and outline styles, each with an accessible label.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: icon only, circle, svg, aria-label, toolbar
- Live preview: https://copy-css.com/snippets/round-icon-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-icon {
display: inline-grid;
place-items: center;
width: 48px;
height: 48px;
padding: 0;
border: 1.5px solid transparent;
border-radius: 50%;
background: #4f46e5;
color: #fff;
cursor: pointer;
transition: background-color 0.2s ease, transform 0.2s ease;
}
.btn-icon svg {
width: 22px;
height: 22px;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
}
.btn-icon:hover {
background: #4338ca;
}
.btn-icon:active {
transform: scale(0.94);
}
.btn-icon-soft {
background: #eef2ff;
color: #4338ca;
}
.btn-icon-soft:hover {
background: #e0e7ff;
}
.btn-icon-outline {
border-color: #d4d4d8;
background: #fff;
color: #3f3f46;
}
.btn-icon-outline:hover {
background: #f4f4f5;
}
.btn-icon:focus-visible {
outline: 2px solid #4f46e5;
outline-offset: 3px;
}
```
### Notes
- This CSS Round Icon Button is 55 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, transforms, CSS Grid and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Icon Label Button
> Buttons with an SVG icon beside the label, perfectly aligned with flexbox and gap.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: leading icon, trailing icon, svg, inline-flex, action
- Live preview: https://copy-css.com/snippets/icon-label-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-icon-label {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 12px 20px;
border: 1px solid transparent;
border-radius: 10px;
background: #0f172a;
color: #fff;
font: 600 15px/1 system-ui, sans-serif;
cursor: pointer;
transition: background-color 0.2s ease;
}
.btn-icon-label svg {
flex: none;
width: 18px;
height: 18px;
fill: none;
stroke: currentColor;
stroke-width: 2.2;
stroke-linecap: round;
stroke-linejoin: round;
}
.btn-icon-label:hover {
background: #1e293b;
}
.btn-icon-label-light {
border-color: #cbd5e1;
background: #fff;
color: #0f172a;
}
.btn-icon-label-light:hover {
background: #f1f5f9;
}
.btn-icon-label:focus-visible {
outline: 2px solid #0f172a;
outline-offset: 3px;
}
```
### Notes
- This CSS Icon Label Button is 43 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, Flexbox and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Expanding Icon Button
> A compact round icon button that slides open to reveal its text label on hover or focus.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: reveal label, compact, circle, width, hover
- Live preview: https://copy-css.com/snippets/expanding-icon-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-expand {
display: inline-flex;
align-items: center;
height: 48px;
padding: 0 13px;
border: 0;
border-radius: 999px;
background: #18181b;
color: #fff;
font: 600 15px/1 system-ui, sans-serif;
cursor: pointer;
transition: padding 0.35s ease;
}
.btn-expand svg {
flex: none;
width: 22px;
height: 22px;
fill: none;
stroke: currentColor;
stroke-width: 2.2;
stroke-linecap: round;
}
/* The label stays in the accessibility tree, it is only clipped */
.btn-expand-label {
max-width: 0;
overflow: hidden;
white-space: nowrap;
opacity: 0;
transition: max-width 0.35s ease, margin 0.35s ease, opacity 0.2s ease;
}
.btn-expand:hover,
.btn-expand:focus-visible {
padding-right: 20px;
}
.btn-expand:hover .btn-expand-label,
.btn-expand:focus-visible .btn-expand-label {
max-width: 140px;
margin-left: 8px;
opacity: 1;
}
.btn-expand:focus-visible {
outline: 2px solid #18181b;
outline-offset: 3px;
}
```
### Notes
- This CSS Expanding Icon Button is 49 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, Flexbox and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Download Button
> A download button with an icon badge, file type and size, and an arrow that bounces on hover.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: file, arrow, file size, bounce, cta
- Live preview: https://copy-css.com/snippets/download-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-download {
display: inline-flex;
align-items: center;
gap: 12px;
padding: 8px 22px 8px 8px;
border: 0;
border-radius: 14px;
background: #047857;
color: #fff;
font: 600 16px/1.2 system-ui, sans-serif;
text-align: left;
cursor: pointer;
transition: background-color 0.2s ease;
}
.btn-download svg {
flex: none;
width: 40px;
height: 40px;
padding: 9px;
border-radius: 10px;
background: #065f46;
fill: none;
stroke: currentColor;
stroke-width: 2.2;
stroke-linecap: round;
stroke-linejoin: round;
box-sizing: border-box;
}
.btn-download small {
display: block;
font-size: 12px;
font-weight: 500;
color: #d1fae5;
}
.btn-download:hover {
background: #065f46;
}
.btn-download:hover .btn-download-arrow {
animation: btn-download-bounce 0.8s ease-in-out infinite;
}
.btn-download:focus-visible {
outline: 3px solid #047857;
outline-offset: 3px;
}
@keyframes btn-download-bounce {
50% { transform: translateY(3px); }
}
@media (prefers-reduced-motion: reduce) {
.btn-download:hover .btn-download-arrow { animation: none; }
}
```
### Notes
- This CSS Download Button is 57 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses keyframe animations, transitions, transforms and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Floating Action Button
> A Material-style floating action button pinned to the corner, with a plus icon that turns on hover.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: fab, material, plus, fixed, mobile
- Live preview: https://copy-css.com/snippets/floating-action-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-fab {
position: fixed;
right: 24px;
bottom: 24px;
z-index: 10;
display: grid;
place-items: center;
width: 56px;
height: 56px;
padding: 0;
border: 0;
border-radius: 16px;
background: #7c3aed;
color: #fff;
box-shadow:
0 4px 8px -2px #4c1d9566,
0 10px 24px -6px #7c3aed99;
cursor: pointer;
transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn-fab svg {
width: 26px;
height: 26px;
fill: none;
stroke: currentColor;
stroke-width: 2.4;
stroke-linecap: round;
transition: transform 0.3s ease;
}
.btn-fab:hover {
background: #6d28d9;
box-shadow:
0 6px 12px -2px #4c1d9566,
0 16px 32px -8px #7c3aed99;
}
.btn-fab:hover svg {
transform: rotate(90deg);
}
.btn-fab:focus-visible {
outline: 3px solid #c4b5fd;
outline-offset: 3px;
}
```
### Notes
- This CSS Floating Action Button is 46 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Close Button
> An accessible X close button for modals, toasts and banners, with a soft hover background.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: x icon, dismiss, modal, dialog, cross
- Live preview: https://copy-css.com/snippets/close-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-close {
display: inline-grid;
place-items: center;
width: 36px;
height: 36px;
padding: 0;
border: 0;
border-radius: 10px;
background: transparent;
color: #52525b;
cursor: pointer;
transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-close svg {
width: 20px;
height: 20px;
fill: none;
stroke: currentColor;
stroke-width: 2.2;
stroke-linecap: round;
}
.btn-close:hover {
background: #f4f4f5;
color: #18181b;
}
.btn-close:active {
background: #e4e4e7;
}
.btn-close:focus-visible {
outline: 2px solid #18181b;
outline-offset: 2px;
}
```
### Notes
- This CSS Close Button is 36 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, CSS Grid and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Spinner Overlay Button
> A loading button that swaps its label for a centered spinner without changing width, driven by aria-busy.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: loading, aria-busy, no layout shift, submit, state
- Live preview: https://copy-css.com/snippets/spinner-overlay-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-busy {
position: relative;
padding: 14px 28px;
border: 0;
border-radius: 10px;
background: #4f46e5;
color: #fff;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
}
.btn-busy:hover {
background: #4338ca;
}
/* The label keeps its space, so the button never changes size */
.btn-busy[aria-busy="true"] {
color: transparent;
pointer-events: none;
}
.btn-busy[aria-busy="true"]::after {
content: "";
position: absolute;
inset: 0;
width: 18px;
height: 18px;
margin: auto;
border: 2.5px solid #ffffff66;
border-top-color: #fff;
border-radius: 50%;
animation: btn-busy-spin 0.7s linear infinite;
}
.btn-busy:focus-visible {
outline: 3px solid #a5b4fc;
outline-offset: 3px;
}
@keyframes btn-busy-spin {
to { transform: rotate(1turn); }
}
@media (prefers-reduced-motion: reduce) {
.btn-busy[aria-busy="true"]::after { animation-duration: 2s; }
}
```
### Notes
- This CSS Spinner Overlay Button is 46 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, keyboard focus styles and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Progress Button
> A button that fills from left to right to show upload progress, set with one custom property.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: upload, fill, percentage, loading, custom property
- Live preview: https://copy-css.com/snippets/progress-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-progress {
--progress: 0%;
position: relative;
isolation: isolate;
overflow: hidden;
min-width: 220px;
padding: 14px 28px;
border: 0;
border-radius: 10px;
background: #1e3a8a;
color: #fff;
font: 600 16px/1 system-ui, sans-serif;
font-variant-numeric: tabular-nums;
cursor: pointer;
}
.btn-progress::before {
content: "";
position: absolute;
inset: 0;
z-index: -1;
width: var(--progress);
background: #2563eb;
transition: width 0.3s ease;
}
.btn-progress[aria-busy="true"] {
cursor: progress;
}
.btn-progress:focus-visible {
outline: 3px solid #2563eb;
outline-offset: 3px;
}
```
### Notes
- This CSS Progress Button is 34 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, keyboard focus styles and custom properties.
- Customize with: `--progress`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Loading Dots Button
> A pill button that shows three bouncing dots after its label while a request is pending.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: three dots, pending, aria-busy, submit, sending
- Live preview: https://copy-css.com/snippets/loading-dots-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-dots {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 14px 28px;
border: 0;
border-radius: 999px;
background: #18181b;
color: #fff;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
}
.btn-dots-anim {
display: none;
gap: 4px;
}
.btn-dots[aria-busy="true"] {
cursor: progress;
}
.btn-dots[aria-busy="true"] .btn-dots-anim {
display: inline-flex;
}
.btn-dots-anim span {
width: 6px;
height: 6px;
border-radius: 50%;
background: currentColor;
animation: btn-dots-bounce 1s ease-in-out infinite;
}
.btn-dots-anim span:nth-child(2) {
animation-delay: 0.15s;
}
.btn-dots-anim span:nth-child(3) {
animation-delay: 0.3s;
}
.btn-dots:focus-visible {
outline: 3px solid #18181b;
outline-offset: 3px;
}
@keyframes btn-dots-bounce {
0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
30% { transform: translateY(-5px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
.btn-dots-anim span { animation: none; }
}
```
### Notes
- This CSS Loading Dots Button is 55 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, Flexbox and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Success State Button
> A submit button that turns green and draws a checkmark when its data-state is set to done.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: checkmark, done, submitted, feedback, confirmation
- Live preview: https://copy-css.com/snippets/success-state-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-success {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 14px 28px;
border: 0;
border-radius: 10px;
background: #2563eb;
color: #fff;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
transition: background-color 0.3s ease;
}
.btn-success svg {
width: 18px;
height: 18px;
fill: none;
stroke: currentColor;
stroke-width: 3;
stroke-linecap: round;
stroke-linejoin: round;
stroke-dasharray: 24;
}
.btn-success[data-state="done"] {
background: #15803d;
animation: btn-success-pop 0.35s ease;
}
.btn-success[data-state="done"] svg {
animation: btn-success-draw 0.4s 0.15s ease-out backwards;
}
.btn-success:focus-visible {
outline: 3px solid #93c5fd;
outline-offset: 3px;
}
@keyframes btn-success-pop {
50% { transform: scale(1.06); }
}
@keyframes btn-success-draw {
from { stroke-dashoffset: 24; }
}
@media (prefers-reduced-motion: reduce) {
.btn-success[data-state="done"],
.btn-success[data-state="done"] svg { animation: none; }
}
```
### Notes
- This CSS Success State Button is 51 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses keyframe animations, transitions, transforms and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Striped Processing Button
> A button with moving diagonal stripes that signal a payment or task is still processing.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: barber pole, pending, busy, payment, animated stripes
- Live preview: https://copy-css.com/snippets/striped-processing-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-stripes {
padding: 14px 28px;
border: 0;
border-radius: 10px;
background-color: #6d28d9;
color: #fff;
font: 600 16px/1 system-ui, sans-serif;
cursor: pointer;
}
.btn-stripes[aria-busy="true"] {
background-image: linear-gradient(
-45deg,
#7c3aed 25%, #6d28d9 25% 50%,
#7c3aed 50% 75%, #6d28d9 75%
);
background-size: 32px 32px;
cursor: progress;
animation: btn-stripes-move 0.8s linear infinite;
}
.btn-stripes:focus-visible {
outline: 3px solid #a78bfa;
outline-offset: 3px;
}
@keyframes btn-stripes-move {
to { background-position: 32px 0; }
}
@media (prefers-reduced-motion: reduce) {
.btn-stripes[aria-busy="true"] { animation: none; }
}
```
### Notes
- This CSS Striped Processing Button is 33 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients, keyboard focus styles and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## 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
```
### 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.
## Outline Button Set
> Outlined buttons in primary, neutral and danger colors that fill solid on hover, themed with one variable.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: outlined, primary, danger, variants, custom property
- Live preview: https://copy-css.com/snippets/outline-button-set
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-outline {
--btn-color: #2563eb;
padding: 12px 24px;
border: 2px solid var(--btn-color);
border-radius: 10px;
background: transparent;
color: var(--btn-color);
font: 600 15px/1 system-ui, sans-serif;
cursor: pointer;
transition: background-color 0.2s ease, color 0.2s ease;
}
.btn-outline:hover {
background: var(--btn-color);
color: #fff;
}
.btn-outline:focus-visible {
outline: 3px solid var(--btn-color);
outline-offset: 3px;
}
.btn-outline-neutral {
--btn-color: #3f3f46;
}
.btn-outline-danger {
--btn-color: #dc2626;
}
```
### Notes
- This CSS Outline Button Set is 29 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions, keyboard focus styles and custom properties.
- Customize with: `--btn-color`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Dashed Add Button
> A wide dashed placeholder button for adding a new item to a list, board or empty state.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: dashed border, plus, empty state, new item, placeholder
- Live preview: https://copy-css.com/snippets/dashed-add-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-dashed {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
width: 260px;
padding: 18px;
border: 2px dashed #cbd5e1;
border-radius: 14px;
background: transparent;
color: #475569;
font: 600 15px/1 system-ui, sans-serif;
cursor: pointer;
transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.btn-dashed svg {
width: 18px;
height: 18px;
fill: none;
stroke: currentColor;
stroke-width: 2.4;
stroke-linecap: round;
}
.btn-dashed:hover {
border-color: #6366f1;
background: #eef2ff;
color: #4338ca;
}
.btn-dashed:focus-visible {
outline: 2px solid #6366f1;
outline-offset: 3px;
}
```
### Notes
- This CSS Dashed Add Button is 35 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, Flexbox and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Double Border Button
> An elegant outlined button with a second thin ring that closes in and fills on hover.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: outline-offset, elegant, serif, luxury, ring
- Live preview: https://copy-css.com/snippets/double-border-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-double {
padding: 15px 34px;
border: 1.5px solid #9f1239;
border-radius: 2px;
background: transparent;
color: #9f1239;
font: 600 14px/1 Georgia, "Times New Roman", serif;
letter-spacing: 0.12em;
text-transform: uppercase;
white-space: nowrap;
outline: 1px solid #9f1239;
outline-offset: 5px;
cursor: pointer;
transition: outline-offset 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}
.btn-double:hover {
outline-offset: 0;
background: #9f1239;
color: #fff;
}
.btn-double:focus-visible {
outline: 2px solid #e11d48;
outline-offset: 8px;
}
```
### Notes
- This CSS Double Border Button is 26 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.
## Text Link Button
> A minimal tertiary button styled like a link, with an underline that tightens and an arrow that nudges.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: tertiary, underline, minimal, arrow, subtle
- Live preview: https://copy-css.com/snippets/text-link-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-text {
padding: 6px 2px;
border: 0;
background: none;
color: #4338ca;
font: 600 16px/1.3 system-ui, sans-serif;
text-decoration: underline;
text-decoration-color: #c7d2fe;
text-decoration-thickness: 2px;
text-underline-offset: 6px;
cursor: pointer;
transition: text-decoration-color 0.2s ease, text-underline-offset 0.2s ease;
}
.btn-text span {
display: inline-block;
transition: transform 0.2s ease;
}
.btn-text:hover {
text-decoration-color: currentColor;
text-underline-offset: 3px;
}
.btn-text:hover span {
transform: translateX(4px);
}
.btn-text:focus-visible {
border-radius: 4px;
outline: 2px solid #4338ca;
outline-offset: 2px;
}
```
### Notes
- This CSS Text Link Button is 33 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, transforms and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Outline Button Group
> A row of joined outline buttons that share borders, ideal for calendar or pager controls.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: joined, toolbar, calendar, attached, actions
- Live preview: https://copy-css.com/snippets/outline-button-group
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-group {
display: inline-flex;
}
.btn-group button {
min-width: 44px;
padding: 10px 16px;
border: 1px solid #d4d4d8;
background: #fff;
color: #27272a;
font: 600 15px/1 system-ui, sans-serif;
cursor: pointer;
transition: background-color 0.15s ease;
}
/* Overlap the borders so they look like one line */
.btn-group button + button {
margin-left: -1px;
}
.btn-group button:first-child {
border-radius: 10px 0 0 10px;
}
.btn-group button:last-child {
border-radius: 0 10px 10px 0;
}
.btn-group button:hover {
background: #f4f4f5;
}
.btn-group button:focus-visible {
position: relative;
z-index: 1;
outline: 2px solid #2563eb;
outline-offset: -1px;
}
```
### Notes
- This CSS Outline Button Group is 38 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, Flexbox and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Social Login Buttons
> Full-width "Continue with Google" and "Continue with GitHub" sign-in buttons with brand logos.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: google, github, sign in, oauth, auth
- Live preview: https://copy-css.com/snippets/social-login-buttons
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.social-login {
display: grid;
gap: 10px;
width: min(100%, 300px);
}
.btn-social {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
padding: 12px 16px;
border: 1px solid transparent;
border-radius: 10px;
font: 600 15px/1 system-ui, sans-serif;
cursor: pointer;
transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-social svg {
flex: none;
width: 20px;
height: 20px;
}
.btn-social-google {
border-color: #dadce0;
background: #fff;
color: #3c4043;
}
.btn-social-google:hover {
background: #f8f9fa;
box-shadow: 0 1px 3px #3c40434d;
}
.btn-social-github {
background: #24292f;
color: #fff;
}
.btn-social-github:hover {
background: #32383f;
}
.btn-social:focus-visible {
outline: 2px solid #2563eb;
outline-offset: 2px;
}
```
### Notes
- This CSS Social Login Buttons is 49 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, box shadows, CSS Grid and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Social Icon Buttons
> Round social media icon links for X, LinkedIn, GitHub and YouTube that fill with brand color on hover.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: x, linkedin, youtube, brand colors, footer
- Live preview: https://copy-css.com/snippets/social-icon-buttons
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.social-icons {
display: flex;
gap: 12px;
margin: 0;
padding: 0;
list-style: none;
}
.social-icons a {
--brand: #18181b;
display: grid;
place-items: center;
width: 44px;
height: 44px;
border: 1.5px solid #e4e4e7;
border-radius: 50%;
color: #3f3f46;
transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.social-icons svg {
width: 18px;
height: 18px;
fill: currentColor;
}
.social-icons a:hover {
border-color: var(--brand);
background: var(--brand);
color: #fff;
transform: translateY(-2px);
}
.social-icons a:focus-visible {
outline: 2px solid var(--brand);
outline-offset: 3px;
}
.social-x { --brand: #000; }
.social-linkedin { --brand: #0a66c2; }
.social-github { --brand: #181717; }
.social-youtube { --brand: #ff0000; }
```
### Notes
- This CSS Social Icon Buttons is 42 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, transforms, CSS Grid and Flexbox.
- Customize with: `--brand`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Share Menu Button
> A share button that slides out X, LinkedIn and email links on hover or keyboard focus, no JavaScript.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: social share, focus-within, reveal, links, hover
- Live preview: https://copy-css.com/snippets/share-menu-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.share-menu {
display: inline-flex;
align-items: center;
gap: 8px;
}
.share-menu-toggle {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 12px 20px;
border: 0;
border-radius: 999px;
background: #0369a1;
color: #fff;
font: 600 15px/1 system-ui, sans-serif;
cursor: pointer;
}
.share-menu-toggle svg,
.share-menu-stroke {
width: 18px;
height: 18px;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
}
.share-menu-list {
display: flex;
gap: 6px;
margin: 0;
padding: 0;
list-style: none;
}
/* Hidden links stay out of the tab order until the menu opens */
.share-menu-list li {
opacity: 0;
visibility: hidden;
transform: translateX(-12px) scale(0.8);
transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0.2s;
}
.share-menu:hover li,
.share-menu:focus-within li {
opacity: 1;
visibility: visible;
transform: none;
transition-delay: 0s;
}
.share-menu li:nth-child(2) { transition-delay: 0.05s; }
.share-menu li:nth-child(3) { transition-delay: 0.1s; }
.share-menu-list a {
display: grid;
place-items: center;
width: 40px;
height: 40px;
border-radius: 50%;
background: #fff;
color: #0c4a6e;
box-shadow: 0 2px 8px #0c4a6e26;
}
.share-menu-list svg {
width: 16px;
height: 16px;
fill: currentColor;
}
.share-menu-list a:hover {
background: #e0f2fe;
}
.share-menu-toggle:focus-visible,
.share-menu-list a:focus-visible {
outline: 2px solid #0369a1;
outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
.share-menu-list li { transform: none; }
}
```
### Notes
- This CSS Share Menu Button is 87 lines of pure CSS (1.6 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Follow Button
> A Follow button that switches to an outlined Following state with a checkmark, using a checkbox.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: toggle, checkbox, following, profile, social
- Live preview: https://copy-css.com/snippets/follow-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-follow {
position: relative;
display: inline-grid;
min-width: 128px;
padding: 11px 20px;
border: 1.5px solid #2563eb;
border-radius: 999px;
background: #2563eb;
color: #fff;
font: 600 15px/1 system-ui, sans-serif;
text-align: center;
cursor: pointer;
user-select: none;
transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-follow input {
position: absolute;
inset: 0;
margin: 0;
opacity: 0;
cursor: pointer;
}
/* Both labels share one grid cell, so the width never jumps */
.btn-follow span {
grid-area: 1 / 1;
}
.btn-follow-on {
visibility: hidden;
}
.btn-follow:hover {
background: #1d4ed8;
}
.btn-follow:has(input:checked) {
border-color: #d4d4d8;
background: #fff;
color: #18181b;
}
.btn-follow:has(input:checked):hover {
background: #f4f4f5;
}
.btn-follow input:checked ~ .btn-follow-off {
visibility: hidden;
}
.btn-follow input:checked ~ .btn-follow-on {
visibility: visible;
}
.btn-follow:has(input:focus-visible) {
outline: 2px solid #2563eb;
outline-offset: 3px;
}
```
### Notes
- This CSS Follow Button is 59 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses transitions, CSS Grid, the :has() selector and the :checked state (no JavaScript).
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Star Count Button
> A GitHub-style Star button with an attached counter that toggles a filled star when checked.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: github, counter, split pill, favorite, open source
- Live preview: https://copy-css.com/snippets/star-count-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-star {
position: relative;
display: inline-flex;
border: 1px solid #d0d7de;
border-radius: 8px;
background: #f6f8fa;
color: #24292f;
font: 600 14px/1 system-ui, sans-serif;
cursor: pointer;
user-select: none;
}
.btn-star input {
position: absolute;
inset: 0;
margin: 0;
opacity: 0;
cursor: pointer;
}
.btn-star-main {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 12px;
}
.btn-star svg {
width: 16px;
height: 16px;
fill: none;
stroke: #57606a;
stroke-width: 2;
stroke-linejoin: round;
transition: fill 0.15s ease, stroke 0.15s ease, transform 0.15s ease;
}
.btn-star-count {
padding: 8px 10px;
border-left: 1px solid #d0d7de;
font-variant-numeric: tabular-nums;
}
.btn-star:hover {
background: #eef1f4;
}
.btn-star input:checked + .btn-star-main svg {
fill: #e3b341;
stroke: #e3b341;
transform: scale(1.15);
}
.btn-star:has(input:focus-visible) {
outline: 2px solid #0969da;
outline-offset: 2px;
}
```
### Notes
- This CSS Star Count Button is 57 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses transitions, transforms, Flexbox and the :has() selector.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Play Pause Button
> A round media button whose play triangle morphs into pause bars when toggled, built on a checkbox.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: media, audio, video, clip-path, morph, toggle
- Live preview: https://copy-css.com/snippets/play-pause-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-play {
position: relative;
display: inline-grid;
place-items: center;
width: 64px;
height: 64px;
border-radius: 50%;
background: #18181b;
color: #fff;
cursor: pointer;
transition: transform 0.15s ease;
}
.btn-play input {
position: absolute;
inset: 0;
margin: 0;
opacity: 0;
cursor: pointer;
}
.btn-play-icon {
position: relative;
width: 22px;
height: 24px;
margin-left: 4px;
pointer-events: none;
transition: margin 0.25s ease;
}
/* Two halves of a triangle that become two bars */
.btn-play-icon::before,
.btn-play-icon::after {
content: "";
position: absolute;
inset: 0;
background: currentColor;
transition: clip-path 0.25s ease;
}
.btn-play-icon::before {
clip-path: polygon(0 0, 50% 25%, 50% 75%, 0 100%);
}
.btn-play-icon::after {
clip-path: polygon(50% 25%, 100% 50%, 100% 50%, 50% 75%);
}
.btn-play input:checked + .btn-play-icon {
margin-left: 0;
}
.btn-play input:checked + .btn-play-icon::before {
clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%);
}
.btn-play input:checked + .btn-play-icon::after {
clip-path: polygon(65% 0, 100% 0, 100% 100%, 65% 100%);
}
.btn-play:active {
transform: scale(0.94);
}
.btn-play:has(input:focus-visible) {
outline: 3px solid #18181b;
outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
.btn-play-icon::before,
.btn-play-icon::after { transition: none; }
}
```
### Notes
- This CSS Play Pause Button is 73 lines of pure CSS (1.4 KB) with no JavaScript and no dependencies. It uses transitions, transforms, clip paths and CSS Grid.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Power Toggle Button
> A round power button that lights up with a cyan glow when switched on, using a hidden checkbox.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: on off, glow, checkbox, switch, dark
- Live preview: https://copy-css.com/snippets/power-toggle-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.btn-power {
position: relative;
display: inline-grid;
place-items: center;
width: 84px;
height: 84px;
border-radius: 50%;
background: linear-gradient(145deg, #1f2937, #111827);
color: #4b5563;
box-shadow:
inset 0 1px 0 #374151,
0 10px 24px #00000099;
cursor: pointer;
transition: color 0.3s ease, box-shadow 0.3s ease;
}
.btn-power input {
position: absolute;
inset: 0;
margin: 0;
opacity: 0;
cursor: pointer;
}
.btn-power svg {
width: 34px;
height: 34px;
fill: none;
stroke: currentColor;
stroke-width: 2.4;
stroke-linecap: round;
pointer-events: none;
transition: filter 0.3s ease;
}
.btn-power:hover {
color: #6b7280;
}
.btn-power:has(input:checked) {
color: #22d3ee;
box-shadow:
inset 0 1px 0 #374151,
0 0 0 2px #22d3ee66,
0 0 32px #22d3ee66;
}
.btn-power:has(input:checked) svg {
filter: drop-shadow(0 0 6px #22d3ee);
}
.btn-power:has(input:focus-visible) {
outline: 2px solid #67e8f9;
outline-offset: 5px;
}
```
### Notes
- This CSS Power Toggle Button is 55 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses transitions, linear gradients, box shadows and filters.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Format Toggle Buttons
> A text editor toolbar of bold, italic, underline and strike toggles that stay pressed when on.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: bold, italic, toolbar, editor, pressed, checkbox
- Live preview: https://copy-css.com/snippets/format-toggle-buttons
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.format-toggles {
display: inline-flex;
gap: 2px;
margin: 0;
padding: 4px;
border: 1px solid #e2e8f0;
border-radius: 12px;
background: #fff;
box-shadow: 0 1px 2px #0f172a14;
}
.format-toggles-legend {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.format-toggles label {
position: relative;
display: grid;
place-items: center;
width: 38px;
height: 38px;
border-radius: 8px;
color: #475569;
font: 17px/1 Georgia, "Times New Roman", serif;
cursor: pointer;
transition: background-color 0.15s ease, color 0.15s ease;
}
.format-toggles input {
position: absolute;
inset: 0;
margin: 0;
opacity: 0;
cursor: pointer;
}
.format-toggles label:hover {
background: #f1f5f9;
color: #0f172a;
}
.format-toggles label:has(input:checked) {
background: #e0e7ff;
color: #3730a3;
}
.format-toggles label:has(input:focus-visible) {
outline: 2px solid #4f46e5;
outline-offset: 1px;
}
```
### Notes
- This CSS Format Toggle Buttons is 55 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses transitions, box shadows, clip paths and CSS Grid.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Show More Button
> A "Show more" toggle built on details and summary that flips to "Show less" and rotates its chevron.
- Category: [CSS Buttons](https://copy-css.com/category/buttons)
- Tags: details, summary, expand, collapse, read more, chevron
- Live preview: https://copy-css.com/snippets/show-more-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Show moreShow less
Every plan includes unlimited projects, priority support and a 30-day money-back guarantee.
```
### CSS
```css
.show-more {
max-width: 320px;
font: 15px/1.5 system-ui, sans-serif;
color: #3f3f46;
}
.show-more summary {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 10px 18px;
border: 1.5px solid #e4e4e7;
border-radius: 999px;
color: #18181b;
font-weight: 600;
list-style: none;
cursor: pointer;
transition: background-color 0.15s ease;
}
.show-more summary::-webkit-details-marker {
display: none;
}
.show-more summary:hover {
background: #f4f4f5;
}
.show-more summary:focus-visible {
outline: 2px solid #18181b;
outline-offset: 2px;
}
.show-more svg {
width: 18px;
height: 18px;
fill: none;
stroke: currentColor;
stroke-width: 2.2;
stroke-linecap: round;
stroke-linejoin: round;
transition: transform 0.2s ease;
}
.show-more-open,
.show-more[open] .show-more-closed {
display: none;
}
.show-more[open] .show-more-open {
display: inline;
}
.show-more[open] svg {
transform: rotate(180deg);
}
.show-more p {
margin: 12px 0 0;
}
```
### Notes
- This CSS Show More Button is 60 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses transitions, transforms, Flexbox and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
# CSS Gradients & Patterns
Linear, radial, conic, mesh and animated gradient backgrounds, plus pure CSS patterns.
## Sunset Gradient
> A warm three-stop linear gradient from orange through pink to violet.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: linear, orange, pink, purple, background
- Live preview: https://copy-css.com/snippets/sunset-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.gradient-sunset {
background: linear-gradient(135deg, #ff9a56 0%, #ff4f8b 50%, #7b5cff 100%);
}
```
### Notes
- This CSS Sunset Gradient is 3 lines of pure CSS (0.1 KB) with no JavaScript and no dependencies. It uses linear gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Ocean Gradient
> A crisp blue linear gradient that works great behind white text.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: linear, blue, cyan, background
- Live preview: https://copy-css.com/snippets/ocean-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.gradient-ocean {
background: linear-gradient(135deg, #00c6fb 0%, #005bea 100%);
}
```
### Notes
- This CSS Ocean Gradient is 3 lines of pure CSS (0.1 KB) with no JavaScript and no dependencies. It uses linear gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Mint Gradient
> A fresh, light green-to-aqua gradient for friendly hero sections.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: linear, green, fresh, background
- Live preview: https://copy-css.com/snippets/mint-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.gradient-mint {
background: linear-gradient(135deg, #a8ff78 0%, #78ffd6 100%);
}
```
### Notes
- This CSS Mint Gradient is 3 lines of pure CSS (0.1 KB) with no JavaScript and no dependencies. It uses linear gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Peach Gradient
> A soft golden peach gradient that feels warm without shouting.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: linear, yellow, orange, warm, background
- Live preview: https://copy-css.com/snippets/peach-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.gradient-peach {
background: linear-gradient(120deg, #f6d365 0%, #fda085 100%);
}
```
### Notes
- This CSS Peach Gradient is 3 lines of pure CSS (0.1 KB) with no JavaScript and no dependencies. It uses linear gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Midnight Gradient
> A deep navy-to-purple gradient for dark, premium-feeling sections.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: linear, dark, navy, purple, background
- Live preview: https://copy-css.com/snippets/midnight-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.gradient-midnight {
background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 55%, #581c87 100%);
}
```
### Notes
- This CSS Midnight Gradient is 3 lines of pure CSS (0.1 KB) with no JavaScript and no dependencies. It uses linear gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Mesh Gradient
> A dreamy pastel mesh gradient built from layered radial gradients.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: mesh, radial, pastel, background
- Live preview: https://copy-css.com/snippets/mesh-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.mesh-gradient {
background-color: #ff99cc;
background-image:
radial-gradient(at 15% 20%, #ffd3a5 0, transparent 55%),
radial-gradient(at 85% 15%, #a0c4ff 0, transparent 55%),
radial-gradient(at 75% 85%, #bdb2ff 0, transparent 55%),
radial-gradient(at 10% 90%, #9bf6ff 0, transparent 55%);
}
```
### Notes
- This CSS Mesh Gradient is 8 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses radial gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Animated Gradient
> A slowly shifting multi-color gradient background, perfect for hero sections.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: animation, moving, background, hero
- Live preview: https://copy-css.com/snippets/animated-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.animated-gradient {
background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
background-size: 400% 400%;
animation: gradient-shift 12s ease infinite;
}
@keyframes gradient-shift {
0%, 100% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
.animated-gradient {
animation: none;
}
}
```
### Notes
- This CSS Animated Gradient is 16 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Conic Rainbow
> A vivid rainbow conic gradient that sweeps around a center point.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: conic, rainbow, colorful, background
- Live preview: https://copy-css.com/snippets/conic-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.conic-gradient {
background: conic-gradient(from 90deg at 50% 50%, #ff6b6b, #feca57, #48dbfb, #a29bfe, #ff6b6b);
}
```
### Notes
- This CSS Conic Rainbow is 3 lines of pure CSS (0.1 KB) with no JavaScript and no dependencies. It uses conic gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Grainy Gradient
> A warm gradient with a film-grain texture made from an inline SVG noise filter.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: noise, grain, texture, svg, background
- Live preview: https://copy-css.com/snippets/grainy-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.grainy-gradient {
background:
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E"),
linear-gradient(135deg, #f43f5e, #f59e0b);
}
```
### Notes
- This CSS Grainy Gradient is 5 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses linear gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Holographic Gradient
> A pale iridescent gradient that feels like holographic foil.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: pastel, holographic, iridescent, linear, background
- Live preview: https://copy-css.com/snippets/holographic-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.holographic {
background: linear-gradient(115deg, #ffd6e8 0%, #c1f0ff 25%, #e0d1ff 50%, #fff3c4 75%, #ffd6e8 100%);
}
```
### Notes
- This CSS Holographic Gradient is 3 lines of pure CSS (0.1 KB) with no JavaScript and no dependencies. It uses linear gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Dot Grid Pattern
> A subtle dotted grid background, great behind canvases and empty states.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: pattern, dots, grid, radial-gradient, background
- Live preview: https://copy-css.com/snippets/dot-grid-pattern
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.dot-grid {
background-color: #f8fafc;
background-image: radial-gradient(#94a3b8 1.2px, transparent 1.4px);
background-size: 18px 18px;
}
```
### Notes
- This CSS Dot Grid Pattern is 5 lines of pure CSS (0.1 KB) with no JavaScript and no dependencies. It uses radial gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Spotlight Gradient
> A soft spotlight glowing down from the top of a dark background.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: radial-gradient, spotlight, dark, vignette, hero
- Live preview: https://copy-css.com/snippets/spotlight-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.spotlight {
background:
radial-gradient(ellipse 60% 70% at 50% -10%, rgba(250, 204, 21, 0.35), transparent 70%),
radial-gradient(ellipse 90% 60% at 50% 120%, rgba(59, 130, 246, 0.18), transparent 70%),
#09090b;
}
```
### Notes
- This CSS Spotlight Gradient is 6 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses radial gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Zigzag Pattern
> A playful zigzag chevron pattern from four angled gradients.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: pattern, zigzag, chevron, linear-gradient, background
- Live preview: https://copy-css.com/snippets/zigzag-pattern
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.zigzag {
--size: 32px;
--a: #f59e0b;
--b: #fef3c7;
background:
linear-gradient(135deg, var(--a) 25%, transparent 25%) calc(var(--size) / -2) 0,
linear-gradient(225deg, var(--a) 25%, transparent 25%) calc(var(--size) / -2) 0,
linear-gradient(315deg, var(--a) 25%, transparent 25%),
linear-gradient(45deg, var(--a) 25%, transparent 25%);
background-size: var(--size) var(--size);
background-color: var(--b);
}
```
### Notes
- This CSS Zigzag Pattern is 12 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses linear gradients and custom properties.
- Customize with: `--size`, `--a`, `--b`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Four Corner Gradient
> A smooth four-color gradient with a different color in each corner, blended with a masked layer.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: mesh, bilinear, mask, pastel, background
- Live preview: https://copy-css.com/snippets/four-corner-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
/* Bottom row of colors on the element, top row on a layer that fades out downward */
.gradient-corners {
position: relative;
isolation: isolate;
background: linear-gradient(90deg, #22d3ee, #a78bfa);
}
.gradient-corners::before {
content: "";
position: absolute;
inset: 0;
z-index: -1;
background: linear-gradient(90deg, #fde047, #f472b6);
-webkit-mask: linear-gradient(#000, #0000);
mask: linear-gradient(#000, #0000);
}
```
### Notes
- This CSS Four Corner Gradient is 16 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses linear gradients and masks.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Blurred Blobs Background
> Two soft, heavily blurred color blobs in opposite corners, a light background for modern hero sections.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: mesh, blur, filter, soft, hero, saas
- Live preview: https://copy-css.com/snippets/blurred-blobs-background
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.blob-bg {
position: relative;
isolation: isolate;
overflow: hidden;
background: #f8fafc;
}
.blob-bg::before,
.blob-bg::after {
content: "";
position: absolute;
z-index: -1;
width: 60%;
aspect-ratio: 1;
border-radius: 50%;
filter: blur(60px);
}
.blob-bg::before {
top: -25%;
left: -10%;
background: #818cf8;
}
.blob-bg::after {
right: -15%;
bottom: -30%;
background: #f472b6;
}
```
### Notes
- This CSS Blurred Blobs Background is 29 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses filters and aspect-ratio.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Animated Mesh Gradient
> Four soft radial color blobs that drift slowly across the background in opposite directions.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: blobs, moving, radial, drift, hero, background
- Live preview: https://copy-css.com/snippets/animated-mesh-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.mesh-animated {
background-color: #fdf2f8;
background-image:
radial-gradient(circle, #f472b6, #0000 30%),
radial-gradient(circle, #60a5fa, #0000 30%),
radial-gradient(circle, #a78bfa, #0000 30%),
radial-gradient(circle, #34d399, #0000 30%);
background-size: 200% 200%;
animation: mesh-animated-drift 16s ease-in-out infinite alternate;
}
@keyframes mesh-animated-drift {
0% { background-position: 0 0, 100% 0, 100% 100%, 0 100%; }
50% { background-position: 60% 20%, 30% 70%, 20% 40%, 80% 60%; }
100% { background-position: 100% 100%, 0 100%, 0 0, 100% 0; }
}
@media (prefers-reduced-motion: reduce) {
.mesh-animated {
animation: none;
background-position: 30% 30%, 70% 30%, 70% 70%, 30% 70%;
}
}
```
### Notes
- This CSS Animated Mesh Gradient is 23 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, radial gradients and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Hue Rotate Gradient
> A gradient that cycles through every hue using a hue-rotate filter on a layer behind the content.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: animated, color cycle, filter, rainbow, background
- Live preview: https://copy-css.com/snippets/hue-rotate-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.gradient-hue {
position: relative;
isolation: isolate;
}
/* The filter sits on its own layer so text inside is not recolored */
.gradient-hue::before {
content: "";
position: absolute;
inset: 0;
z-index: -1;
background: linear-gradient(135deg, #f43f5e, #f59e0b);
animation: gradient-hue-cycle 12s linear infinite;
}
@keyframes gradient-hue-cycle {
to { filter: hue-rotate(1turn); }
}
@media (prefers-reduced-motion: reduce) {
.gradient-hue::before { animation: none; }
}
```
### Notes
- This CSS Hue Rotate Gradient is 22 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients, filters and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Donut Chart
> A donut chart with a legend, drawn with one conic gradient and a radial mask, no SVG or JavaScript.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: conic-gradient, pie chart, data, legend, mask
- Live preview: https://copy-css.com/snippets/donut-chart
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Search 45%
Social 30%
Direct 25%
```
### CSS
```css
.donut-chart {
/* Segment sizes; the last one fills the rest */
--a: 45%;
--b: 30%;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 20px;
margin: 0;
font: 500 14px/1.2 system-ui, sans-serif;
color: #27272a;
}
.donut-chart-ring {
width: 120px;
aspect-ratio: 1;
border-radius: 50%;
background: conic-gradient(
#6366f1 0 var(--a),
#ec4899 0 calc(var(--a) + var(--b)),
#f59e0b 0
);
-webkit-mask: radial-gradient(farthest-side, #0000 58%, #000 59%);
mask: radial-gradient(farthest-side, #0000 58%, #000 59%);
}
.donut-chart-legend {
display: grid;
gap: 10px;
margin: 0;
padding: 0;
list-style: none;
}
.donut-chart-legend li {
display: flex;
align-items: center;
gap: 8px;
}
.donut-chart-legend li::before {
content: "";
width: 12px;
height: 12px;
border-radius: 3px;
background: #6366f1;
}
.donut-chart-legend li:nth-child(2)::before {
background: #ec4899;
}
.donut-chart-legend li:nth-child(3)::before {
background: #f59e0b;
}
```
### Notes
- This CSS Donut Chart is 56 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses radial gradients, conic gradients, masks and CSS Grid.
- Customize with: `--a`, `--b`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Color Wheel
> A full hue color wheel that fades to white in the center, made from a conic and a radial gradient.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: conic-gradient, hue, color picker, rainbow, radial
- Live preview: https://copy-css.com/snippets/color-wheel
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.color-wheel {
width: 180px;
aspect-ratio: 1;
border-radius: 50%;
background:
radial-gradient(circle closest-side, #fff, #fff0),
conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
box-shadow: 0 8px 24px #18181b29;
}
```
### Notes
- This CSS Color Wheel is 9 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses radial gradients, conic gradients, box shadows and aspect-ratio.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Conic Light Beam
> A dark hero background with a soft cone of light shining down from the top, built with a conic gradient.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: spotlight, cone, dark, hero, glow, stage
- Live preview: https://copy-css.com/snippets/conic-light-beam
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.light-beam {
background:
radial-gradient(ellipse 35% 8% at 50% 0, #e0e7ff, #0000),
linear-gradient(#02061700 20%, #020617),
conic-gradient(
from 140deg at 50% -5%,
#0000,
#6366f140 25deg,
#c7d2fe99 40deg,
#6366f140 55deg,
#0000 80deg
),
#020617;
}
```
### Notes
- This CSS Conic Light Beam is 14 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses linear gradients, radial gradients and conic gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Image Scrim Gradient
> An eased dark gradient over a photo so white caption text stays readable without a hard edge.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: overlay, text on image, readable, caption, eased
- Live preview: https://copy-css.com/snippets/image-scrim-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Sunset ridge trail12 km · Moderate
```
### CSS
```css
.scrim-card {
position: relative;
width: min(100%, 280px);
margin: 0;
overflow: hidden;
border-radius: 16px;
font: 14px/1.3 system-ui, sans-serif;
}
.scrim-card img {
display: block;
width: 100%;
aspect-ratio: 3 / 2;
object-fit: cover;
}
/* Many stops ease the fade, so there is no visible line where it starts */
.scrim-card::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(
to top,
#000000b3 0%,
#000000a1 14%,
#00000080 28%,
#00000059 42%,
#00000033 56%,
#00000014 70%,
#0000 85%
);
}
.scrim-card figcaption {
position: absolute;
inset: auto 0 0;
z-index: 1;
display: grid;
gap: 2px;
padding: 16px;
color: #fff;
}
.scrim-card strong {
font-size: 18px;
}
.scrim-card span {
color: #e5e7eb;
}
```
### Notes
- This CSS Image Scrim Gradient is 50 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses linear gradients, CSS Grid and aspect-ratio.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Fade Edge Mask
> A horizontal scroller whose edges fade out with a mask gradient, hinting that there is more to scroll.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: mask-image, scroll, overflow, carousel, fade out
- Live preview: https://copy-css.com/snippets/fade-edge-mask
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Design
Development
Marketing
Product
Research
Writing
Sales
Support
```
### CSS
```css
.fade-edges {
--fade: 40px;
display: flex;
gap: 8px;
width: min(100%, 300px);
margin: 0;
padding: 4px 0;
overflow-x: auto;
list-style: none;
scrollbar-width: none;
-webkit-mask: linear-gradient(90deg, #0000, #000 var(--fade), #000 calc(100% - var(--fade)), #0000);
mask: linear-gradient(90deg, #0000, #000 var(--fade), #000 calc(100% - var(--fade)), #0000);
}
.fade-edges::-webkit-scrollbar {
display: none;
}
.fade-edges li {
flex: none;
padding: 8px 14px;
border-radius: 999px;
background: #eef2ff;
color: #3730a3;
font: 600 14px/1 system-ui, sans-serif;
}
/* Drawn inside the box so the mask does not hide it */
.fade-edges:focus-visible {
border-radius: 8px;
outline: 2px solid #4f46e5;
outline-offset: -2px;
}
```
### Notes
- This CSS Fade Edge Mask is 33 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses linear gradients, masks, Flexbox and keyboard focus styles.
- Customize with: `--fade`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## OKLCH Gradient
> A gradient interpolated in OKLCH so the middle stays bright and saturated instead of going gray.
- Category: [CSS Gradients & Patterns](https://copy-css.com/category/gradients)
- Tags: color space, interpolation, vivid, no gray, modern
- Live preview: https://copy-css.com/snippets/oklch-gradient
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.gradient-oklch {
/* Fallback for older browsers */
background: linear-gradient(90deg, #ec4899, #06b6d4);
/* Mixing in OKLCH avoids the muddy middle of sRGB gradients */
background: linear-gradient(90deg in oklch, #ec4899, #06b6d4);
}
```
### Notes
- This CSS OKLCH Gradient is 6 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses linear gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
# CSS Box Shadows
Soft layered, neumorphic, glowing and retro box-shadow recipes.
## Soft Layered Shadow
> A realistic, soft elevation made from four stacked low-opacity shadows.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: box-shadow, layered, subtle, elevation
- Live preview: https://copy-css.com/snippets/soft-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.shadow-soft {
background: #fff;
border-radius: 20px;
box-shadow:
0 1px 2px rgba(0, 0, 0, 0.04),
0 4px 8px rgba(0, 0, 0, 0.04),
0 12px 24px rgba(0, 0, 0, 0.06),
0 24px 48px rgba(0, 0, 0, 0.08);
}
```
### Notes
- This CSS Soft Layered Shadow is 9 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Neumorphism
> The classic soft-UI neumorphic look using a light and a dark shadow.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: neumorphic, soft ui, box-shadow, light
- Live preview: https://copy-css.com/snippets/neumorphism
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.neumorphism {
background: #e0e5ec;
border-radius: 28px;
box-shadow:
9px 9px 16px #a3b1c6,
-9px -9px 16px #ffffff;
}
```
### Notes
- This CSS Neumorphism is 7 lines of pure CSS (0.1 KB) with no JavaScript and no dependencies. It uses box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Colored Glow Shadow
> A colored shadow that makes an element look like it is softly glowing.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: glow, colored, box-shadow, purple
- Live preview: https://copy-css.com/snippets/glow-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.shadow-glow {
background: linear-gradient(135deg, #6366f1, #8b5cf6);
border-radius: 20px;
box-shadow: 0 20px 50px -12px rgba(99, 102, 241, 0.75);
}
```
### Notes
- This CSS Colored Glow Shadow is 5 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses linear gradients and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Stacked Retro Shadow
> Two hard, colorful offset shadows stacked for a playful retro feel.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: retro, offset, stacked, playful
- Live preview: https://copy-css.com/snippets/retro-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.shadow-retro {
background: #fff;
border: 2px solid #111;
border-radius: 12px;
box-shadow:
6px 6px 0 #f472b6,
12px 12px 0 #60a5fa;
}
```
### Notes
- This CSS Stacked Retro Shadow is 8 lines of pure CSS (0.1 KB) with no JavaScript and no dependencies. It uses box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Inner Shadow
> A subtle inset shadow for pressed states, wells and input fields.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: inset, pressed, well, box-shadow
- Live preview: https://copy-css.com/snippets/inset-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.shadow-inset {
background: #f1f5f9;
border-radius: 20px;
box-shadow:
inset 0 2px 6px rgba(15, 23, 42, 0.14),
inset 0 -1px 0 rgba(255, 255, 255, 0.8);
}
```
### Notes
- This CSS Inner Shadow is 7 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Elevation Scale
> Three ready-made shadow levels for a consistent design system.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: elevation, design system, box-shadow, levels
- Live preview: https://copy-css.com/snippets/elevation-scale
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.elevation-1 {
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 1px 4px rgba(15, 23, 42, 0.06);
}
.elevation-2 {
box-shadow: 0 4px 8px -2px rgba(15, 23, 42, 0.12), 0 2px 4px -2px rgba(15, 23, 42, 0.08);
}
.elevation-3 {
box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.2), 0 6px 12px -6px rgba(15, 23, 42, 0.12);
}
```
### Notes
- This CSS Elevation Scale is 11 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Smooth Hairline Shadow
> A hairline edge plus doubling shadow layers for crisp, natural depth.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: smooth, hairline, layered, box-shadow, crisp
- Live preview: https://copy-css.com/snippets/smooth-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.shadow-smooth {
background: #fff;
border-radius: 18px;
box-shadow:
0 0 0 1px rgba(0, 0, 0, 0.04),
0 1px 1px -0.5px rgba(0, 0, 0, 0.05),
0 3px 3px -1.5px rgba(0, 0, 0, 0.05),
0 6px 6px -3px rgba(0, 0, 0, 0.05),
0 12px 12px -6px rgba(0, 0, 0, 0.05),
0 24px 24px -12px rgba(0, 0, 0, 0.05);
}
```
### Notes
- This CSS Smooth Hairline Shadow is 11 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Drop Shadow Filter
> filter: drop-shadow() follows the real shape, including this speech bubble tail.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: filter, drop-shadow, speech bubble, shape
- Live preview: https://copy-css.com/snippets/drop-shadow-filter
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
My shadow follows my tail!
```
### CSS
```css
.bubble {
position: relative;
max-width: 200px;
padding: 14px 18px;
border-radius: 16px;
background: #fff;
color: #111;
font: 500 15px/1.4 system-ui, sans-serif;
filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
}
.bubble::after {
content: "";
position: absolute;
bottom: -10px;
left: 24px;
border: 10px solid transparent;
border-top-color: #fff;
border-bottom: 0;
}
```
### Notes
- This CSS Drop Shadow Filter is 20 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses filters.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Lifted Corners Shadow
> Two angled shadows under the bottom corners make the card look gently curled up.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: paper, curled, corners, pseudo-element, box-shadow
- Live preview: https://copy-css.com/snippets/lifted-corners-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
/* Tip: give the parent `isolation: isolate` so the pseudo-element shadows stay visible */
.shadow-lifted {
position: relative;
background: #fff;
}
.shadow-lifted::before,
.shadow-lifted::after {
content: "";
position: absolute;
z-index: -1;
bottom: 14px;
width: 45%;
height: 20%;
box-shadow: 0 14px 12px rgba(0, 0, 0, 0.28);
}
.shadow-lifted::before {
left: 8px;
transform: rotate(-4deg);
}
.shadow-lifted::after {
right: 8px;
transform: rotate(4deg);
}
```
### Notes
- This CSS Lifted Corners Shadow is 26 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transforms and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Paper Stack
> A sheet with two slightly rotated pages peeking out from behind it.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: stack, paper, layers, pseudo-element, depth
- Live preview: https://copy-css.com/snippets/paper-stack-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
/* Tip: give the parent `isolation: isolate` so the pseudo-element shadows stay visible */
.paper-stack {
position: relative;
border-radius: 6px;
background: #fff;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.paper-stack::before,
.paper-stack::after {
content: "";
position: absolute;
inset: 0;
z-index: -1;
border-radius: 6px;
background: #fafafa;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.paper-stack::before {
transform: rotate(-4deg);
}
.paper-stack::after {
transform: rotate(3deg) translate(4px, 2px);
}
```
### Notes
- This CSS Paper Stack is 26 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transforms and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Double Focus Ring
> A clear two-tone focus ring made with spread shadows, so it follows rounded corners.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: focus, ring, accessibility, outline, spread
- Live preview: https://copy-css.com/snippets/focus-ring-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.ring-focus {
padding: 12px 24px;
border: 1px solid #d4d4d8;
border-radius: 10px;
background: #fff;
color: #18181b;
font: 600 15px/1 system-ui, sans-serif;
cursor: pointer;
transition: box-shadow 0.15s ease;
}
.ring-focus:focus-visible,
.ring-focus:hover {
outline: none;
box-shadow:
0 0 0 2px #fff,
0 0 0 4px #2563eb,
0 0 0 8px rgba(37, 99, 235, 0.2);
}
```
### Notes
- This CSS Double Focus Ring is 19 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses transitions, box shadows and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Hover Depth Shadow
> Fades in a deep shadow on hover with opacity, which animates more smoothly than box-shadow.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: hover, transition, elevation, performance, opacity
- Live preview: https://copy-css.com/snippets/hover-depth-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.depth-hover {
position: relative;
border-radius: 16px;
background: #fff;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
transition: transform 0.25s ease;
}
/* The big shadow lives on a pseudo-element and only its opacity animates */
.depth-hover::after {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
box-shadow: 0 22px 40px -12px rgba(15, 23, 42, 0.35);
opacity: 0;
transition: opacity 0.25s ease;
}
.depth-hover:hover {
transform: translateY(-4px);
}
.depth-hover:hover::after {
opacity: 1;
}
```
### Notes
- This CSS Hover Depth Shadow is 26 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions, transforms and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Ambient Color Shadow
> A shadow that takes its colors from the element itself, like the glow behind album art.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: colored, ambient, glow, blur, image, shadow
- Live preview: https://copy-css.com/snippets/ambient-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.ambient {
/* Works with images too: url("cover.jpg") */
--art: linear-gradient(135deg, #f472b6, #8b5cf6 50%, #38bdf8);
position: relative;
isolation: isolate;
width: 160px;
height: 120px;
}
.ambient::before,
.ambient::after {
content: "";
position: absolute;
inset: 0;
border-radius: 16px;
background: var(--art) center / cover;
}
/* A blurred copy sits behind and becomes the shadow */
.ambient::before {
z-index: -1;
inset: 14px 10px -14px;
filter: blur(22px) saturate(1.4);
opacity: 0.85;
}
```
### Notes
- This CSS Ambient Color Shadow is 25 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses linear gradients, filters and custom properties.
- Customize with: `--art`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Multiple Borders
> Stack as many borders as you like with comma-separated box-shadow spreads. No extra markup.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: border, rings, spread, outline, stacked, box-shadow
- Live preview: https://copy-css.com/snippets/multi-border-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.rings {
--gap: #fff7ed; /* match the background behind it */
width: 80px;
height: 80px;
border-radius: 20px;
background: #f97316;
box-shadow:
0 0 0 6px var(--gap),
0 0 0 12px #fb923c,
0 0 0 18px var(--gap),
0 0 0 24px #fdba74;
}
```
### Notes
- This CSS Multiple Borders is 12 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses box shadows and custom properties.
- Customize with: `--gap`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Floating Shadow
> An object that bobs up and down while its ground shadow shrinks and fades in sync.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: float, levitate, bob, ground shadow, animation
- Live preview: https://copy-css.com/snippets/floating-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.float {
display: inline-flex;
flex-direction: column;
align-items: center;
gap: 26px;
}
.float-item {
width: 84px;
height: 84px;
border-radius: 22px;
background: linear-gradient(135deg, #34d399, #0ea5e9);
animation: float-y 3s ease-in-out infinite;
}
/* The ground shadow stays put and breathes */
.float::after {
content: "";
width: 70px;
height: 12px;
border-radius: 50%;
background: rgba(15, 23, 42, 0.35);
filter: blur(3px);
animation: float-shadow 3s ease-in-out infinite;
}
@keyframes float-y {
50% { transform: translateY(-14px); }
}
@keyframes float-shadow {
50% { transform: scale(0.7); opacity: 0.5; }
}
@media (prefers-reduced-motion: reduce) {
.float-item,
.float::after { animation: none; }
}
```
### Notes
- This CSS Floating Shadow is 38 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, linear gradients and filters.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Dark UI Edge Light
> Shadows barely show on dark backgrounds, so this lifts the card with a hairline border and a lit top edge.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: dark mode, elevation, hairline, highlight, inset, card
- Live preview: https://copy-css.com/snippets/dark-edge-light
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Deploys
12 today · all green
```
### CSS
```css
.edge-card {
width: 220px;
padding: 20px;
border-radius: 14px;
background: #18181b;
color: #a1a1aa;
font: 14px/1.5 system-ui, sans-serif;
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.08),
0 0 0 1px rgba(255, 255, 255, 0.06),
0 1px 2px rgba(0, 0, 0, 0.6),
0 12px 32px -8px rgba(0, 0, 0, 0.8);
}
.edge-card h3 {
margin: 0 0 4px;
color: #fafafa;
font-size: 16px;
}
.edge-card p {
margin: 0;
}
```
### Notes
- This CSS Dark UI Edge Light is 23 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## One-Sided Shadows
> Box shadows on just one edge (top, right, bottom or left) using a negative spread value.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: bottom only, negative spread, top, side, box-shadow
- Live preview: https://copy-css.com/snippets/one-sided-shadows
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Top
Right
Bottom
Left
```
### CSS
```css
/* The negative spread (-6px) hides the shadow on the other three sides */
.side-shadow-top,
.side-shadow-right,
.side-shadow-bottom,
.side-shadow-left {
display: grid;
place-items: center;
width: 96px;
height: 64px;
border-radius: 12px;
background: #ffffff;
color: #475569;
font: 600 13px system-ui, sans-serif;
}
.side-shadow-top {
box-shadow: 0 -8px 10px -6px #0f172a59;
}
.side-shadow-right {
box-shadow: 8px 0 10px -6px #0f172a59;
}
.side-shadow-bottom {
box-shadow: 0 8px 10px -6px #0f172a59;
}
.side-shadow-left {
box-shadow: -8px 0 10px -6px #0f172a59;
}
```
### Notes
- This CSS One-Sided Shadows is 30 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Deep Diffuse Shadow
> A deep, very soft four-layer shadow that makes a card float high above the page.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: layered, soft, floating, hero, pricing card
- Live preview: https://copy-css.com/snippets/deep-diffuse-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Pro plan$12 per month
```
### CSS
```css
.shadow-deep {
display: grid;
gap: 4px;
width: 180px;
padding: 22px;
border-radius: 20px;
background: #ffffff;
color: #0f172a;
font: 15px/1.4 system-ui, sans-serif;
box-shadow:
0 2px 4px #0f172a0a,
0 8px 16px #0f172a0d,
0 24px 48px -8px #0f172a1f,
0 48px 96px -24px #0f172a33;
}
.shadow-deep strong {
font-size: 18px;
}
.shadow-deep span {
color: #64748b;
}
```
### Notes
- This CSS Deep Diffuse Shadow is 23 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Perspective Cast Shadow
> A shadow cast across the floor behind an object, made by skewing a blurred pseudo-element.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: cast shadow, skew, floor, pseudo-element, product
- Live preview: https://copy-css.com/snippets/perspective-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
/* Give the parent isolation: isolate if the shadow hides behind its background */
.shadow-cast {
position: relative;
width: 100px;
height: 130px;
border-radius: 14px;
background: linear-gradient(160deg, #fde68a, #f59e0b);
}
.shadow-cast::after {
content: "";
position: absolute;
z-index: -1;
inset: 0;
border-radius: 14px;
background: #451a03;
opacity: 0.35;
filter: blur(6px);
transform-origin: bottom;
transform: skewX(-50deg) scaleY(0.45);
}
```
### Notes
- This CSS Perspective Cast Shadow is 21 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transforms, linear gradients and filters.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Scroll Header Shadow
> A sticky header that gains a soft shadow only once its panel scrolls, using a scroll-driven animation.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: sticky header, scroll-driven, animation-timeline, elevation, panel
- Live preview: https://copy-css.com/snippets/scroll-header-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Inbox
Design review moved to 3pm
New comment on Homepage v2
Invoice #1042 was paid
Weekly report is ready
Alex shared a file with you
Your trial ends in 3 days
```
### CSS
```css
.scroll-panel {
width: 240px;
height: 170px;
overflow: auto;
border-radius: 14px;
background: #ffffff;
color: #334155;
font: 14px/1.4 system-ui, sans-serif;
box-shadow: 0 0 0 1px #e2e8f0;
scroll-timeline: --panel-scroll;
}
.scroll-panel:focus-visible {
outline: 2px solid #2563eb;
outline-offset: 2px;
}
.scroll-panel-head {
position: sticky;
top: 0;
padding: 12px 16px;
background: #ffffff;
color: #0f172a;
font-weight: 700;
}
.scroll-panel p {
margin: 0;
padding: 10px 16px;
border-top: 1px solid #f1f5f9;
}
/* Browsers without scroll-driven animations keep a flat header */
@supports (animation-timeline: scroll()) {
.scroll-panel-head {
animation: scroll-panel-lift linear both;
animation-timeline: --panel-scroll;
animation-range: 0 24px;
}
}
@keyframes scroll-panel-lift {
to { box-shadow: 0 6px 12px -6px #0f172a40; }
}
@media (prefers-reduced-motion: reduce) {
.scroll-panel-head { animation: none; }
}
```
### Notes
- This CSS Scroll Header Shadow is 48 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses scroll-driven animations, keyframe animations, box shadows and sticky positioning.
- scroll-driven animations: Chrome and Edge 115+ and Safari 26+. Firefox support is very recent; browsers without it skip the animation and show the content as is.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Neumorphic Button
> A soft UI button that sits raised from the surface and smoothly presses in when clicked.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: neumorphism, soft ui, pressed, inset, active state
- Live preview: https://copy-css.com/snippets/neumorphic-button
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.neu-btn {
padding: 16px 36px;
border: 0;
border-radius: 16px;
background: #e0e5ec;
color: #475569;
font: 600 16px system-ui, sans-serif;
cursor: pointer;
box-shadow:
6px 6px 12px #a3b1c6,
-6px -6px 12px #ffffff,
inset 0 0 0 #a3b1c6,
inset 0 0 0 #ffffff;
transition: box-shadow 0.2s ease, color 0.2s ease;
}
.neu-btn:hover {
color: #4338ca;
}
.neu-btn:active {
box-shadow:
0 0 0 #a3b1c6,
0 0 0 #ffffff,
inset 4px 4px 8px #a3b1c6,
inset -4px -4px 8px #ffffff;
}
.neu-btn:focus-visible {
outline: 2px solid #4338ca;
outline-offset: 4px;
}
```
### Notes
- This CSS Neumorphic Button is 32 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, box shadows and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Dark Neumorphism
> Soft UI for dark themes: a raised tile holding a pressed-in knob, both shaded from one surface color.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: neumorphic, soft ui, dark mode, raised, inset
- Live preview: https://copy-css.com/snippets/dark-neumorphism
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.neu-dark {
--surface: #1e2228;
--shade: #121519;
--light: #2a2f37;
display: grid;
place-items: center;
width: 150px;
height: 150px;
border-radius: 32px;
background: var(--surface);
box-shadow:
10px 10px 20px var(--shade),
-10px -10px 20px var(--light);
}
.neu-dark-knob {
width: 64px;
height: 64px;
border-radius: 50%;
background: var(--surface);
box-shadow:
inset 6px 6px 12px var(--shade),
inset -6px -6px 12px var(--light),
0 0 0 2px #22d3ee26;
}
```
### Notes
- This CSS Dark Neumorphism is 25 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses box shadows, CSS Grid and custom properties.
- Customize with: `--surface`, `--shade`, `--light`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Concave Neumorphism
> Convex and concave soft UI surfaces side by side, shaped by flipping one diagonal gradient.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: convex, neumorphic, soft ui, gradient, dial
- Live preview: https://copy-css.com/snippets/concave-neumorphism
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.neu-convex,
.neu-concave {
width: 90px;
height: 90px;
border-radius: 50%;
box-shadow:
8px 8px 16px #b8bec7,
-8px -8px 16px #ffffff;
}
/* Light top-left = bulges out */
.neu-convex {
background: linear-gradient(145deg, #f0f4f9, #caced4);
}
/* Dark top-left = dips in */
.neu-concave {
background: linear-gradient(145deg, #caced4, #f0f4f9);
}
```
### Notes
- This CSS Concave Neumorphism is 19 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses linear gradients and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Neumorphic Inset Field
> A soft UI search field carved into the surface with paired inset shadows and a clear focus ring.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: neumorphic, input, search, inset, soft ui
- Live preview: https://copy-css.com/snippets/neumorphic-inset-field
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.neu-field {
display: grid;
gap: 8px;
width: 230px;
color: #475569;
font: 600 13px system-ui, sans-serif;
}
.neu-field input {
box-sizing: border-box;
width: 100%;
padding: 14px 18px;
border: 0;
border-radius: 14px;
background: #e0e5ec;
color: #1e293b;
font: 15px system-ui, sans-serif;
-webkit-appearance: none;
appearance: none;
box-shadow:
inset 5px 5px 10px #a3b1c6,
inset -5px -5px 10px #ffffff;
}
.neu-field input::placeholder {
color: #64748b;
}
.neu-field input:focus-visible {
outline: 2px solid #6366f1;
outline-offset: 3px;
}
```
### Notes
- This CSS Neumorphic Inset Field is 32 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses box shadows, CSS Grid and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Gradient Glow Shadow
> A rainbow gradient shadow glowing out from under a dark card, made from a blurred pseudo-element.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: rainbow, blur, colorful, pseudo-element, dark card
- Live preview: https://copy-css.com/snippets/gradient-glow-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Pro
```
### CSS
```css
/* Give the parent isolation: isolate if the glow hides behind its background */
.glow-gradient {
position: relative;
display: grid;
place-items: center;
width: 160px;
height: 110px;
border-radius: 18px;
background: #0f172a;
color: #f8fafc;
font: 700 22px system-ui, sans-serif;
}
.glow-gradient::before {
content: "";
position: absolute;
z-index: -1;
inset: 0;
border-radius: inherit;
background: linear-gradient(90deg, #f43f5e, #a855f7, #3b82f6, #22d3ee);
filter: blur(20px);
opacity: 0.9;
transform: translateY(12px) scale(0.95);
}
```
### Notes
- This CSS Gradient Glow Shadow is 24 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transforms, linear gradients, filters and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Neon Border Glow
> A neon-tube box that glows both inward and outward from its border, with matching glowing text.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: neon, tube, inset, dark, sign, cyberpunk
- Live preview: https://copy-css.com/snippets/neon-border-glow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
ONLINE
```
### CSS
```css
.neon-box {
--neon: #e879f9;
padding: 18px 30px;
border: 2px solid #f5d0fe;
border-radius: 14px;
color: #fdf4ff;
font: 700 18px/1 system-ui, sans-serif;
letter-spacing: 0.2em;
text-shadow: 0 0 8px var(--neon);
box-shadow:
0 0 6px var(--neon),
0 0 18px #d946ef,
0 0 42px #a21caf,
inset 0 0 6px var(--neon),
inset 0 0 18px #d946ef80;
}
```
### Notes
- This CSS Neon Border Glow is 16 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses box shadows, text shadows and custom properties.
- Customize with: `--neon`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Colored Hover Shadow
> A card whose neutral shadow turns into a soft glow in its accent color on hover or keyboard focus.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: glow, hover, card, brand color, transition
- Live preview: https://copy-css.com/snippets/hover-glow-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
AnalyticsSee what is working
```
### CSS
```css
.glow-hover {
--accent: #10b981;
display: grid;
gap: 4px;
width: 190px;
padding: 20px;
border-radius: 16px;
background: #ffffff;
color: #0f172a;
font: 15px/1.4 system-ui, sans-serif;
text-decoration: none;
box-shadow:
0 0 0 1px #e2e8f0,
0 4px 12px -4px #0f172a1f;
transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.glow-hover span {
color: #64748b;
}
.glow-hover:hover,
.glow-hover:focus-visible {
transform: translateY(-3px);
box-shadow:
0 0 0 1px var(--accent),
0 14px 34px -8px var(--accent);
}
.glow-hover:focus-visible {
outline: 2px solid #0f172a;
outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
.glow-hover { transition: box-shadow 0.3s ease; }
.glow-hover:hover,
.glow-hover:focus-visible { transform: none; }
}
```
### Notes
- This CSS Colored Hover Shadow is 40 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and CSS Grid.
- Customize with: `--accent`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Dual Color Glow
> Two colored glows bleeding from opposite corners of a white card, cyan top-left and pink bottom-right.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: two tone, colored, glow, offset, gradient look
- Live preview: https://copy-css.com/snippets/dual-color-glow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.glow-duo {
width: 140px;
height: 140px;
border-radius: 24px;
background: #ffffff;
box-shadow:
-14px -12px 40px -6px #22d3ee99,
14px 12px 40px -6px #f472b699;
}
```
### Notes
- This CSS Dual Color Glow is 9 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Inner Glow
> A dark panel lit from the inside edge with layered inset glows, like frosted acrylic.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: inset, glow, dark, edge light, glassy
- Live preview: https://copy-css.com/snippets/inner-glow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.inner-glow {
--glow: #38bdf8;
width: 170px;
height: 115px;
border-radius: 20px;
background: #0b1120;
box-shadow:
inset 0 0 0 1px #38bdf866,
inset 0 0 22px #38bdf84d,
inset 0 -40px 50px -30px var(--glow);
}
```
### Notes
- This CSS Inner Glow is 11 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses box shadows and custom properties.
- Customize with: `--glow`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Scroll Shadows
> Shadows that appear at the top and bottom of a scroll box only while more content is hidden there.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: overflow, scroll hint, background-attachment, list, no javascript
- Live preview: https://copy-css.com/snippets/scroll-shadows
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
v2.6 Faster search
v2.5 Keyboard shortcuts
v2.4 Dark mode
v2.3 Team folders
v2.2 Export to PDF
v2.1 Comments
v2.0 New editor
```
### CSS
```css
/* White covers move with the content (local) and hide the shadows at either end */
.scroll-shadows {
box-sizing: border-box;
width: 220px;
max-height: 150px;
margin: 0;
padding: 0 16px;
overflow: auto;
border-radius: 12px;
list-style: none;
color: #334155;
font: 14px/1.4 system-ui, sans-serif;
background:
linear-gradient(#ffffff 30%, #ffffff00) top / 100% 40px no-repeat local,
linear-gradient(#ffffff00, #ffffff 70%) bottom / 100% 40px no-repeat local,
radial-gradient(farthest-side at 50% 0, #0f172a40, #0f172a00) top / 100% 14px no-repeat scroll,
radial-gradient(farthest-side at 50% 100%, #0f172a40, #0f172a00) bottom / 100% 14px no-repeat scroll,
#ffffff;
}
.scroll-shadows li {
padding: 10px 0;
border-bottom: 1px solid #f1f5f9;
}
.scroll-shadows:focus-visible {
outline: 2px solid #2563eb;
outline-offset: 2px;
}
```
### Notes
- This CSS Scroll Shadows is 29 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses linear gradients, radial gradients and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Inset Border Shadow
> Borders drawn with inset box-shadow, so hover and selected states never shift the layout.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: border, no layout shift, selected, ring, inset
- Live preview: https://copy-css.com/snippets/inset-border-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Basic
Pro
Team
```
### CSS
```css
.inset-border {
display: grid;
place-items: center;
width: 64px;
height: 64px;
border-radius: 14px;
background: #f8fafc;
color: #334155;
font: 600 14px system-ui, sans-serif;
box-shadow: inset 0 0 0 1px #e2e8f0;
transition: box-shadow 0.2s ease;
}
.inset-border:hover {
box-shadow: inset 0 0 0 2px #94a3b8;
}
/* Thicker ring, same box size: nothing around it moves */
.inset-border.is-selected {
background: #eef2ff;
color: #3730a3;
box-shadow: inset 0 0 0 3px #6366f1;
}
```
### Notes
- This CSS Inset Border Shadow is 23 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Material Elevation Levels
> Material-style elevation at 1, 3, 6 and 12dp, each built from umbra, penumbra and ambient shadows.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: material design, umbra, penumbra, ambient, dp
- Live preview: https://copy-css.com/snippets/material-elevation
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
1
3
6
12
```
### CSS
```css
.md-surface {
--umbra: #00000033;
--penumbra: #00000024;
--ambient: #0000001f;
display: grid;
place-items: center;
width: 64px;
height: 64px;
border-radius: 8px;
background: #ffffff;
color: #616161;
font: 500 14px system-ui, sans-serif;
}
.md-elevation-1 {
box-shadow:
0 2px 1px -1px var(--umbra),
0 1px 1px 0 var(--penumbra),
0 1px 3px 0 var(--ambient);
}
.md-elevation-3 {
box-shadow:
0 3px 3px -2px var(--umbra),
0 3px 4px 0 var(--penumbra),
0 1px 8px 0 var(--ambient);
}
.md-elevation-6 {
box-shadow:
0 3px 5px -1px var(--umbra),
0 6px 10px 0 var(--penumbra),
0 1px 18px 0 var(--ambient);
}
.md-elevation-12 {
box-shadow:
0 7px 8px -4px var(--umbra),
0 12px 17px 2px var(--penumbra),
0 5px 22px 4px var(--ambient);
}
```
### Notes
- This CSS Material Elevation Levels is 41 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses box shadows, CSS Grid and custom properties.
- Customize with: `--umbra`, `--penumbra`, `--ambient`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Dark Mode Elevation
> Elevation for dark themes, where higher surfaces get lighter instead of relying on shadows alone.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: dark theme, surface, lighter, overlay, levels
- Live preview: https://copy-css.com/snippets/dark-mode-elevation
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
1
2
3
4
```
### CSS
```css
/* Page background: #121212 */
.dm-surface {
display: grid;
place-items: center;
width: 48px;
height: 48px;
border-radius: 12px;
color: #e0e0e0;
font: 600 14px system-ui, sans-serif;
}
.dm-level-1 {
background: #1e1e1e;
box-shadow: 0 1px 2px #00000066;
}
.dm-level-2 {
background: #242424;
box-shadow: 0 2px 6px #00000080;
}
.dm-level-3 {
background: #2c2c2c;
box-shadow: 0 6px 14px #00000099;
}
.dm-level-4 {
background: #383838;
box-shadow: 0 12px 28px #000000b3;
}
```
### Notes
- This CSS Dark Mode Elevation is 30 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Tinted Elevation Scale
> An elevation scale whose shadows are tinted with your brand color, so they look clean on colored pages.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: colored, color-mix, brand, levels, design tokens
- Live preview: https://copy-css.com/snippets/tinted-elevation
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.tinted-elevation {
--tint: #4338ca;
width: 64px;
height: 64px;
border-radius: 16px;
background: #ffffff;
}
.tinted-elevation-1 {
box-shadow:
0 1px 2px color-mix(in srgb, var(--tint) 20%, transparent),
0 2px 6px -1px color-mix(in srgb, var(--tint) 16%, transparent);
}
.tinted-elevation-2 {
box-shadow:
0 2px 4px color-mix(in srgb, var(--tint) 16%, transparent),
0 10px 20px -6px color-mix(in srgb, var(--tint) 28%, transparent);
}
.tinted-elevation-3 {
box-shadow:
0 4px 8px color-mix(in srgb, var(--tint) 14%, transparent),
0 24px 44px -12px color-mix(in srgb, var(--tint) 40%, transparent);
}
```
### Notes
- This CSS Tinted Elevation Scale is 25 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses box shadows and custom properties.
- Customize with: `--tint`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Popover Shadow
> A crisp, high-elevation shadow for popovers and dropdowns, with a hairline edge and a matching arrow.
- Category: [CSS Box Shadows](https://copy-css.com/category/shadows)
- Tags: dropdown, menu, overlay, tooltip, hairline
- Live preview: https://copy-css.com/snippets/popover-shadow
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Saved to library
Find it under Favorites any time.
```
### CSS
```css
.popover-panel {
position: relative;
width: 220px;
padding: 14px 16px;
border-radius: 12px;
background: #ffffff;
color: #475569;
font: 14px/1.45 system-ui, sans-serif;
box-shadow:
0 0 0 1px #0f172a14,
0 4px 6px -2px #0f172a14,
0 12px 24px -6px #0f172a29,
0 24px 48px -12px #0f172a1f;
}
/* Arrow: a rotated square sharing the hairline edge */
.popover-panel::before {
content: "";
position: absolute;
top: -6px;
left: 24px;
width: 12px;
height: 12px;
background: #ffffff;
box-shadow: -1px -1px 0 #0f172a14;
transform: rotate(45deg);
}
.popover-panel strong {
display: block;
margin-bottom: 2px;
color: #0f172a;
}
.popover-panel p {
margin: 0;
}
```
### Notes
- This CSS Popover Shadow is 37 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transforms and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
# CSS Loaders & Spinners
Pure CSS spinners, dots, progress bars and skeleton screens. No JavaScript required.
## Ring Spinner
> The essential loading spinner: a single element with a colored arc.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: spinner, loading, circle, rotate
- Live preview: https://copy-css.com/snippets/ring-spinner
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.spinner {
width: 48px;
height: 48px;
border: 5px solid #e5e7eb;
border-top-color: #6366f1;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
.spinner {
animation-duration: 2s;
}
}
```
### Notes
- This CSS Ring Spinner is 18 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Bouncing Dots
> Three dots bouncing in sequence, great for typing and loading states.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: dots, loading, typing, bounce
- Live preview: https://copy-css.com/snippets/bouncing-dots
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-dots {
display: flex;
gap: 8px;
}
.loader-dots span {
width: 14px;
height: 14px;
border-radius: 50%;
background: #0ea5e9;
animation: loader-dots-bounce 0.6s ease-in-out infinite alternate;
}
.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes loader-dots-bounce {
to {
transform: translateY(-14px);
opacity: 0.4;
}
}
@media (prefers-reduced-motion: reduce) {
.loader-dots span {
animation-duration: 1.5s;
}
}
```
### Notes
- This CSS Bouncing Dots is 28 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, Flexbox and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Pulse Ring
> A dot that sends out a fading ring, ideal for online or live indicators.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: pulse, status, online, ping
- Live preview: https://copy-css.com/snippets/pulse-ring
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.pulse-dot {
display: block;
width: 18px;
height: 18px;
border-radius: 50%;
background: #10b981;
animation: pulse-ring 1.6s ease-out infinite;
}
@keyframes pulse-ring {
0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
100% { box-shadow: 0 0 0 26px rgba(16, 185, 129, 0); }
}
@media (prefers-reduced-motion: reduce) {
.pulse-dot {
animation: none;
}
}
```
### Notes
- This CSS Pulse Ring is 19 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses keyframe animations, box shadows and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Indeterminate Progress Bar
> A slim gradient progress bar that slides endlessly while content loads.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: progress, bar, loading, linear
- Live preview: https://copy-css.com/snippets/progress-bar
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.progress-bar {
position: relative;
overflow: hidden;
width: 220px;
height: 6px;
border-radius: 999px;
background: #e5e7eb;
}
.progress-bar::before {
content: "";
position: absolute;
inset: 0;
width: 40%;
border-radius: inherit;
background: linear-gradient(90deg, #6366f1, #ec4899);
animation: progress-slide 1.2s ease-in-out infinite;
}
@keyframes progress-slide {
from { transform: translateX(-100%); }
to { transform: translateX(250%); }
}
@media (prefers-reduced-motion: reduce) {
.progress-bar::before {
animation-duration: 2.4s;
}
}
```
### Notes
- This CSS Indeterminate Progress Bar is 29 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, linear gradients and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Skeleton Shimmer
> Shimmering placeholder lines that show content is on its way.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: skeleton, placeholder, shimmer, loading
- Live preview: https://copy-css.com/snippets/skeleton-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.skeleton-card {
display: grid;
gap: 12px;
}
.skeleton {
width: 220px;
height: 14px;
border-radius: 7px;
background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 37%, #e5e7eb 63%);
background-size: 400% 100%;
animation: shimmer 1.4s ease infinite;
}
.skeleton-title {
width: 140px;
height: 20px;
}
.skeleton-short {
width: 160px;
}
@keyframes shimmer {
from { background-position: 100% 50%; }
to { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
.skeleton {
animation: none;
}
}
```
### Notes
- This CSS Skeleton Shimmer is 33 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients, CSS Grid and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Gradient Spinner
> A smooth spinner with a fading gradient tail, made from one element and a mask.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: spinner, conic-gradient, mask, loading, purple
- Live preview: https://copy-css.com/snippets/gradient-spinner
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.spinner-gradient {
width: 52px;
height: 52px;
border-radius: 50%;
background: conic-gradient(from 0deg, transparent, #8b5cf6);
-webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
animation: gradient-spin 0.9s linear infinite;
}
@keyframes gradient-spin {
to { transform: rotate(1turn); }
}
@media (prefers-reduced-motion: reduce) {
.spinner-gradient {
animation-duration: 2s;
}
}
```
### Notes
- This CSS Gradient Spinner is 19 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, radial gradients and conic gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Equalizer Bars
> Five bars bouncing like an audio equalizer. Great for music apps.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: bars, equalizer, audio, loading, music
- Live preview: https://copy-css.com/snippets/equalizer-bars
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.bars {
display: flex;
align-items: center;
gap: 5px;
height: 40px;
}
.bars span {
width: 6px;
height: 100%;
border-radius: 3px;
background: #f59e0b;
animation: bars-scale 1s ease-in-out infinite;
}
.bars span:nth-child(2) { animation-delay: -0.8s; }
.bars span:nth-child(3) { animation-delay: -0.6s; }
.bars span:nth-child(4) { animation-delay: -0.4s; }
.bars span:nth-child(5) { animation-delay: -0.2s; }
@keyframes bars-scale {
0%, 100% { transform: scaleY(0.3); }
50% { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
.bars span {
animation-duration: 2s;
}
}
```
### Notes
- This CSS Equalizer Bars is 30 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, Flexbox and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Orbit Loader
> A glowing dot orbiting a dashed ring. Calm and a little playful.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: orbit, planet, spinner, loading, glow
- Live preview: https://copy-css.com/snippets/orbit-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.orbit {
position: relative;
width: 56px;
height: 56px;
border: 2px dashed #a5b4c8;
border-radius: 50%;
animation: orbit-spin 1.6s linear infinite;
}
.orbit::before {
content: "";
position: absolute;
top: -7px;
left: calc(50% - 6px);
width: 12px;
height: 12px;
border-radius: 50%;
background: #06b6d4;
box-shadow: 0 0 12px #06b6d4;
}
@keyframes orbit-spin {
to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
.orbit {
animation-duration: 3.2s;
}
}
```
### Notes
- This CSS Orbit Loader is 30 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, box shadows and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Striped Progress Bar
> A progress bar with moving candy stripes. Set the inner width to the percentage.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: progress, stripes, bar, animated, determinate
- Live preview: https://copy-css.com/snippets/striped-progress
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.progress-striped {
width: 220px;
height: 14px;
padding: 3px;
border-radius: 999px;
background: #e2e8f0;
}
.progress-striped div {
height: 100%;
border-radius: inherit;
background: repeating-linear-gradient(45deg, #3b82f6 0 10px, #60a5fa 10px 20px);
background-size: 28.28px 28.28px;
animation: stripes-move 1s linear infinite;
}
@keyframes stripes-move {
to { background-position: 28.28px 0; }
}
@media (prefers-reduced-motion: reduce) {
.progress-striped div {
animation: none;
}
}
```
### Notes
- This CSS Striped Progress Bar is 25 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Flipping Square
> A square that flips in 3D on both axes. A tiny, eye-catching loader.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: 3d, flip, square, loading, perspective
- Live preview: https://copy-css.com/snippets/square-flip-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.flip-loader {
width: 40px;
height: 40px;
border-radius: 6px;
background: #ec4899;
animation: square-flip 1.2s ease-in-out infinite;
}
@keyframes square-flip {
0% { transform: perspective(120px) rotateX(0) rotateY(0); }
50% { transform: perspective(120px) rotateX(-180deg) rotateY(0); }
100% { transform: perspective(120px) rotateX(-180deg) rotateY(-180deg); }
}
@media (prefers-reduced-motion: reduce) {
.flip-loader {
animation-duration: 2.4s;
}
}
```
### Notes
- This CSS Flipping Square is 19 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, 3D transforms, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Grid Pulse Loader
> A 3×3 grid of squares that pulse in a diagonal wave.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: grid, squares, pulse, stagger, spinner
- Live preview: https://copy-css.com/snippets/grid-pulse-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.grid-pulse {
display: grid;
grid-template-columns: repeat(3, 12px);
gap: 5px;
}
.grid-pulse span {
width: 12px;
height: 12px;
border-radius: 3px;
background: #38bdf8;
animation: grid-pulse 1.2s ease-in-out infinite;
}
/* Delay by diagonal: (row + column) × 0.1s */
.grid-pulse span:nth-child(2),
.grid-pulse span:nth-child(4) { animation-delay: 0.1s; }
.grid-pulse span:nth-child(3),
.grid-pulse span:nth-child(5),
.grid-pulse span:nth-child(7) { animation-delay: 0.2s; }
.grid-pulse span:nth-child(6),
.grid-pulse span:nth-child(8) { animation-delay: 0.3s; }
.grid-pulse span:nth-child(9) { animation-delay: 0.4s; }
@keyframes grid-pulse {
0%, 60%, 100% { transform: scale(1); opacity: 1; }
30% { transform: scale(0.4); opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) {
.grid-pulse span {
animation-duration: 2.4s;
}
}
```
### Notes
- This CSS Grid Pulse Loader is 34 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, CSS Grid and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Typing Indicator
> A chat bubble with three softly rising dots while someone types.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: chat, typing, dots, bubble, message
- Live preview: https://copy-css.com/snippets/typing-indicator
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.typing-indicator {
display: inline-flex;
gap: 5px;
padding: 14px 16px;
border-radius: 18px 18px 18px 4px;
background: #fff;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.typing-indicator span {
width: 8px;
height: 8px;
border-radius: 50%;
background: #a1a1aa;
animation: typing-indicator-rise 1.2s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-indicator-rise {
0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
30% { transform: translateY(-5px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
.typing-indicator span {
animation-duration: 2.4s;
}
}
```
### Notes
- This CSS Typing Indicator is 30 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, box shadows and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Circular Progress
> A circular progress ring driven by a single --value custom property.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: progress, circle, conic-gradient, percentage, determinate
- Live preview: https://copy-css.com/snippets/circular-progress
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
72%
```
### CSS
```css
.progress-ring {
--value: 0; /* 0 to 100 */
--track: #e2e8f0;
--fill: #8b5cf6;
display: grid;
place-items: center;
width: 96px;
height: 96px;
border-radius: 50%;
background:
radial-gradient(closest-side, #fff 78%, transparent 79%),
conic-gradient(var(--fill) calc(var(--value) * 1%), var(--track) 0);
color: #1e293b;
font: 700 20px/1 system-ui, sans-serif;
}
```
### Notes
- This CSS Circular Progress is 15 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses radial gradients, conic gradients, CSS Grid and custom properties.
- Customize with: `--value`, `--track`, `--fill`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Clock Loader
> A tiny clock face whose hands spin while you wait.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: clock, hands, rotate, waiting, time
- Live preview: https://copy-css.com/snippets/clock-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.clock-loader {
position: relative;
width: 44px;
height: 44px;
border: 4px solid #ea580c;
border-radius: 50%;
}
.clock-loader::before,
.clock-loader::after {
content: "";
position: absolute;
left: calc(50% - 2px);
bottom: 50%;
width: 4px;
border-radius: 2px;
background: #ea580c;
transform-origin: 50% 100%;
animation: clock-spin linear infinite;
}
/* Minute hand */
.clock-loader::before {
height: 15px;
animation-duration: 1s;
}
/* Hour hand */
.clock-loader::after {
height: 10px;
animation-duration: 12s;
}
@keyframes clock-spin {
to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
.clock-loader::before {
animation-duration: 4s;
}
}
```
### Notes
- This CSS Clock Loader is 42 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Segmented Spinner
> A system-style spinner with fading segments, drawn from one element with a conic gradient and a mask.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: spinner, ios, segments, conic, mask, loading
- Live preview: https://copy-css.com/snippets/segmented-spinner
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.spinner-seg {
width: 48px;
height: 48px;
border-radius: 50%;
background: conic-gradient(rgba(14, 165, 233, 0.08), #0ea5e9);
-webkit-mask:
radial-gradient(farthest-side, transparent 52%, #000 54%),
repeating-conic-gradient(#000 0 20deg, transparent 0 30deg);
-webkit-mask-composite: source-in;
mask:
radial-gradient(farthest-side, transparent 52%, #000 54%),
repeating-conic-gradient(#000 0 20deg, transparent 0 30deg);
mask-composite: intersect;
animation: spinner-seg 1s steps(12) infinite;
}
@keyframes spinner-seg {
to { transform: rotate(1turn); }
}
@media (prefers-reduced-motion: reduce) {
.spinner-seg {
animation-duration: 2s;
}
}
```
### Notes
- This CSS Segmented Spinner is 25 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, radial gradients and conic gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Animated Ellipsis
> Loading text whose three dots appear one by one, using clip-path and a stepped animation.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: ellipsis, dots, loading, text, steps
- Live preview: https://copy-css.com/snippets/animated-ellipsis
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Loading
```
### CSS
```css
.loading-dots {
margin: 0;
color: #334155;
font: 600 20px system-ui, sans-serif;
}
.loading-dots::after {
content: "...";
display: inline-block;
clip-path: inset(0 100% 0 0);
animation: ellipsis 1.4s steps(4, jump-none) infinite;
}
@keyframes ellipsis {
to { clip-path: inset(0); }
}
@media (prefers-reduced-motion: reduce) {
.loading-dots::after {
clip-path: none;
animation: none;
}
}
```
### Notes
- This CSS Animated Ellipsis is 23 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses keyframe animations, clip paths and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Heartbeat Loader
> A pulse line that traces across like a heart monitor, using an SVG stroke dash animation.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: heartbeat, pulse, ecg, svg, stroke, health
- Live preview: https://copy-css.com/snippets/heartbeat-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.heartbeat {
width: 160px;
height: 54px;
overflow: visible;
}
.heartbeat path {
fill: none;
stroke: #ef4444;
stroke-width: 2.5;
stroke-linecap: round;
stroke-linejoin: round;
stroke-dasharray: 30 100;
filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.7));
animation: heartbeat 1.6s linear infinite;
}
@keyframes heartbeat {
from { stroke-dashoffset: 30; }
to { stroke-dashoffset: -100; }
}
@media (prefers-reduced-motion: reduce) {
.heartbeat path {
animation-duration: 3.2s;
}
}
```
### Notes
- This CSS Heartbeat Loader is 27 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, filters and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Text Fill Loader
> The word “Loading” fills with color from left to right, using background-clip: text.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: text, fill, loading, background-clip, progress
- Live preview: https://copy-css.com/snippets/text-fill-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Loading
```
### CSS
```css
.text-loader {
color: transparent;
font: 800 34px/1 system-ui, sans-serif;
letter-spacing: 0.04em;
text-transform: uppercase;
background:
linear-gradient(#6366f1 0 0) left / 0% 100% no-repeat,
#e2e8f0;
-webkit-background-clip: text;
background-clip: text;
animation: text-fill 2s ease-in-out infinite;
}
@keyframes text-fill {
to { background-size: 100% 100%; }
}
@media (prefers-reduced-motion: reduce) {
.text-loader {
animation-duration: 4s;
}
}
```
### Notes
- This CSS Text Fill Loader is 22 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients, gradient-clipped text and reduced-motion support.
- gradient-clipped text: Includes the -webkit- prefix Safari still needs.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Nested Rings Spinner
> Three nested arcs in different colors spinning at different speeds, built from one element.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: arcs, circles, concentric, multicolor, rotate
- Live preview: https://copy-css.com/snippets/nested-rings-spinner
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.spinner-nested {
position: relative;
width: 64px;
height: 64px;
border: 3px solid transparent;
border-top-color: #6366f1;
border-radius: 50%;
animation: spinner-nested-spin 1.4s linear infinite;
}
.spinner-nested::before,
.spinner-nested::after {
content: "";
position: absolute;
border: 3px solid transparent;
border-radius: 50%;
}
.spinner-nested::before {
inset: 5px;
border-top-color: #ec4899;
animation: spinner-nested-spin 1s linear infinite reverse;
}
.spinner-nested::after {
inset: 15px;
border-top-color: #f59e0b;
animation: spinner-nested-spin 0.7s linear infinite;
}
@keyframes spinner-nested-spin {
to { transform: rotate(1turn); }
}
@media (prefers-reduced-motion: reduce) {
.spinner-nested,
.spinner-nested::before,
.spinner-nested::after { animation-duration: 3s; }
}
```
### Notes
- This CSS Nested Rings Spinner is 39 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Material Spinner
> The Material Design circular spinner: an SVG arc that grows and shrinks while it rotates.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: svg, stroke-dasharray, android, circular, indeterminate
- Live preview: https://copy-css.com/snippets/material-spinner
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.spinner-material {
width: 48px;
height: 48px;
animation: spinner-material-rotate 2s linear infinite;
}
.spinner-material circle {
fill: none;
stroke: #2563eb;
stroke-width: 4;
stroke-linecap: round;
stroke-dasharray: 1 150;
animation: spinner-material-dash 1.5s ease-in-out infinite;
}
@keyframes spinner-material-rotate {
to { transform: rotate(1turn); }
}
@keyframes spinner-material-dash {
0% { stroke-dasharray: 1 150; stroke-dashoffset: 0; }
50% { stroke-dasharray: 90 150; stroke-dashoffset: -35; }
100% { stroke-dasharray: 90 150; stroke-dashoffset: -124; }
}
@media (prefers-reduced-motion: reduce) {
.spinner-material { animation-duration: 4s; }
.spinner-material circle { animation: none; stroke-dasharray: 90 150; }
}
```
### Notes
- This CSS Material Spinner is 29 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Hourglass Loader
> A minimal hourglass made of two border triangles whose sand drains before it flips over.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: sand, waiting, flip, border triangles, timer
- Live preview: https://copy-css.com/snippets/hourglass-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-hourglass {
width: 0;
height: 0;
border: 22px solid transparent;
border-top-color: #b45309;
border-bottom-color: #fde68a;
animation: loader-hourglass-flip 2s ease-in-out infinite;
}
/* Sand drains from top to bottom, then the glass turns over */
@keyframes loader-hourglass-flip {
0% {
border-top-color: #b45309;
border-bottom-color: #fde68a;
transform: rotate(0);
}
75% {
border-top-color: #fde68a;
border-bottom-color: #b45309;
transform: rotate(0);
}
100% {
border-top-color: #fde68a;
border-bottom-color: #b45309;
transform: rotate(180deg);
}
}
@media (prefers-reduced-motion: reduce) {
.loader-hourglass { animation-duration: 4s; }
}
```
### Notes
- This CSS Hourglass Loader is 31 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Dot Circle Spinner
> A classic ring of eight fading dots, drawn with radial gradients on one element and turned in steps.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: classic, fading, radial-gradient, steps, single element
- Live preview: https://copy-css.com/snippets/dot-circle-spinner
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.spinner-dot-circle {
--c: #0284c7;
width: 52px;
height: 52px;
background:
radial-gradient(circle at 50% 9%, var(--c) 4.5px, #0000 5px),
radial-gradient(circle at 79% 21%, color-mix(in srgb, var(--c) 88%, #0000) 4.5px, #0000 5px),
radial-gradient(circle at 91% 50%, color-mix(in srgb, var(--c) 76%, #0000) 4.5px, #0000 5px),
radial-gradient(circle at 79% 79%, color-mix(in srgb, var(--c) 64%, #0000) 4.5px, #0000 5px),
radial-gradient(circle at 50% 91%, color-mix(in srgb, var(--c) 52%, #0000) 4.5px, #0000 5px),
radial-gradient(circle at 21% 79%, color-mix(in srgb, var(--c) 40%, #0000) 4.5px, #0000 5px),
radial-gradient(circle at 9% 50%, color-mix(in srgb, var(--c) 28%, #0000) 4.5px, #0000 5px),
radial-gradient(circle at 21% 21%, color-mix(in srgb, var(--c) 16%, #0000) 4.5px, #0000 5px);
animation: spinner-dot-circle-turn 0.9s steps(8) infinite;
}
@keyframes spinner-dot-circle-turn {
to { transform: rotate(1turn); }
}
@media (prefers-reduced-motion: reduce) {
.spinner-dot-circle { animation-duration: 2.4s; }
}
```
### Notes
- This CSS Dot Circle Spinner is 23 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, radial gradients and custom properties.
- Customize with: `--c`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Pie Timer Loader
> A pie that fills clockwise like a countdown, made with a thick SVG stroke and stroke-dasharray.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: countdown, svg, stroke-dasharray, sweep, clock
- Live preview: https://copy-css.com/snippets/pie-timer-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-pie {
width: 56px;
height: 56px;
border-radius: 50%;
background: #fecdd3;
transform: rotate(-90deg);
}
/* r = 8 and stroke-width = 16 turn the stroke into a filled pie (2πr ≈ 50.3) */
.loader-pie circle {
fill: none;
stroke: #e11d48;
stroke-width: 16;
stroke-dasharray: 0 50.3;
animation: loader-pie-fill 2s linear infinite;
}
@keyframes loader-pie-fill {
to { stroke-dasharray: 50.3 50.3; }
}
@media (prefers-reduced-motion: reduce) {
.loader-pie circle { animation-duration: 5s; }
}
```
### Notes
- This CSS Pie Timer Loader is 24 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Infinity Loader
> A glowing segment that races endlessly around a figure-eight SVG path.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: figure eight, svg, path, stroke-dashoffset, snake
- Live preview: https://copy-css.com/snippets/infinity-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-infinity {
width: 120px;
height: 60px;
overflow: visible;
}
.loader-infinity path {
fill: none;
stroke-width: 3;
stroke-linecap: round;
}
.loader-infinity-track {
stroke: #1e293b;
}
.loader-infinity-snake {
stroke: #22d3ee;
stroke-dasharray: 22 78;
filter: drop-shadow(0 0 3px #22d3ee);
animation: loader-infinity-run 1.6s linear infinite;
}
@keyframes loader-infinity-run {
to { stroke-dashoffset: -100; }
}
@media (prefers-reduced-motion: reduce) {
.loader-infinity-snake { animation-duration: 4s; }
}
```
### Notes
- This CSS Infinity Loader is 30 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, filters and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Loading Overlay
> A frosted overlay with a spinner that covers any card or section while it has aria-busy set.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: backdrop-filter, blur, card, aria-busy, spinner
- Live preview: https://copy-css.com/snippets/loading-overlay
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Monthly report
Revenue grew 12% compared with last month, led by annual plans.
```
### CSS
```css
.overlay-panel {
position: relative;
width: min(100%, 280px);
padding: 20px;
border-radius: 16px;
background: #fff;
color: #334155;
font: 15px/1.5 system-ui, sans-serif;
box-shadow: 0 4px 16px #0f172a14;
}
.overlay-panel h3 {
margin: 0 0 6px;
color: #0f172a;
font-size: 17px;
}
.overlay-panel p {
margin: 0;
}
.loading-overlay {
position: absolute;
inset: 0;
display: none;
place-items: center;
border-radius: inherit;
background: #ffffffa6;
-webkit-backdrop-filter: blur(3px);
backdrop-filter: blur(3px);
}
/* Show the overlay only while the section is busy */
[aria-busy="true"] > .loading-overlay {
display: grid;
}
.loading-overlay::after {
content: "";
width: 32px;
height: 32px;
border: 3px solid #cbd5e1;
border-top-color: #4f46e5;
border-radius: 50%;
animation: loading-overlay-spin 0.8s linear infinite;
}
@keyframes loading-overlay-spin {
to { transform: rotate(1turn); }
}
@media (prefers-reduced-motion: reduce) {
.loading-overlay::after { animation-duration: 2s; }
}
```
### Notes
- This CSS Loading Overlay is 54 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, box shadows and backdrop filters.
- backdrop filters: Includes the -webkit- prefix for older Safari.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Sliding Dots Loader
> Small dots that glide across a line, slowing down in the middle, like the classic Windows loader.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: gliding, windows, horizontal, ease, stagger
- Live preview: https://copy-css.com/snippets/sliding-dots-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-slide {
position: relative;
width: 180px;
height: 8px;
}
.loader-slide span {
position: absolute;
top: 0;
left: 0;
width: 8px;
height: 8px;
border-radius: 50%;
background: #2563eb;
opacity: 0;
animation: loader-slide-move 2.6s linear infinite;
}
.loader-slide span:nth-child(2) { animation-delay: 0.18s; }
.loader-slide span:nth-child(3) { animation-delay: 0.36s; }
.loader-slide span:nth-child(4) { animation-delay: 0.54s; }
@keyframes loader-slide-move {
0% { left: 0; opacity: 0; }
15% { opacity: 1; }
40% { left: 44%; }
60% { left: 52%; }
85% { opacity: 1; }
100% { left: calc(100% - 8px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
.loader-slide span { animation-duration: 5s; }
}
```
### Notes
- This CSS Sliding Dots Loader is 34 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Dot Swap Loader
> Two colored dots that circle around each other and trade places, passing in front and behind.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: dots, orbit, two colors, trade places, z-index
- Live preview: https://copy-css.com/snippets/dot-swap-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-swap {
position: relative;
width: 44px;
height: 16px;
}
.loader-swap::before,
.loader-swap::after {
content: "";
position: absolute;
top: 0;
width: 16px;
height: 16px;
border-radius: 50%;
animation: 1.1s ease-in-out infinite;
}
.loader-swap::before {
left: 0;
background: #f43f5e;
animation-name: loader-swap-a;
}
.loader-swap::after {
right: 0;
z-index: 1;
background: #06b6d4;
animation-name: loader-swap-b;
}
@keyframes loader-swap-a {
0% { transform: translateX(0); z-index: 2; }
25% { transform: translateX(14px) scale(1.3); z-index: 2; }
49% { z-index: 2; }
50% { transform: translateX(28px); z-index: 0; }
75% { transform: translateX(14px) scale(0.7); z-index: 0; }
100% { transform: translateX(0); z-index: 0; }
}
@keyframes loader-swap-b {
0% { transform: translateX(0); }
25% { transform: translateX(-14px) scale(0.7); }
50% { transform: translateX(-28px); }
75% { transform: translateX(-14px) scale(1.3); }
100% { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
.loader-swap::before,
.loader-swap::after { animation-duration: 3s; }
}
```
### Notes
- This CSS Dot Swap Loader is 51 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Bouncing Ball Loader
> A ball that bounces with a squash on landing and a shadow that grows as it falls.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: bounce, squash, shadow, physics, playful
- Live preview: https://copy-css.com/snippets/bouncing-ball-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-ball {
position: relative;
width: 40px;
height: 84px;
}
.loader-ball::before {
content: "";
position: absolute;
top: 0;
left: 8px;
width: 24px;
height: 24px;
border-radius: 50%;
background: #ea580c;
transform-origin: 50% 100%;
animation: loader-ball-bounce 0.5s cubic-bezier(0.5, 0, 1, 0.5) infinite alternate;
}
.loader-ball::after {
content: "";
position: absolute;
bottom: 0;
left: 6px;
width: 28px;
height: 6px;
border-radius: 50%;
background: #7c2d1240;
animation: loader-ball-shadow 0.5s cubic-bezier(0.5, 0, 1, 0.5) infinite alternate;
}
@keyframes loader-ball-bounce {
0% { transform: translateY(0); }
85% { transform: translateY(54px) scale(1, 1); }
100% { transform: translateY(54px) scale(1.2, 0.8); }
}
@keyframes loader-ball-shadow {
from { transform: scale(0.5); opacity: 0.4; }
to { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
.loader-ball::before,
.loader-ball::after { animation-duration: 1.2s; }
}
```
### Notes
- This CSS Bouncing Ball Loader is 46 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Gooey Dots Loader
> Two dots that melt into each other like liquid as they pass, using the blur and contrast filter trick.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: metaball, blur, contrast, filter, liquid
- Live preview: https://copy-css.com/snippets/gooey-dots-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
/* The container needs a solid background for the contrast trick to work */
.loader-gooey {
position: relative;
width: 120px;
height: 44px;
background: #fff;
filter: contrast(20);
}
.loader-gooey::before,
.loader-gooey::after {
content: "";
position: absolute;
top: 10px;
width: 24px;
height: 24px;
border-radius: 50%;
background: #000;
filter: blur(5px);
}
.loader-gooey::before {
left: 48px;
}
.loader-gooey::after {
left: 8px;
animation: loader-gooey-move 1.8s ease-in-out infinite alternate;
}
@keyframes loader-gooey-move {
to { transform: translateX(80px); }
}
@media (prefers-reduced-motion: reduce) {
.loader-gooey::after { animation-duration: 4s; }
}
```
### Notes
- This CSS Gooey Dots Loader is 37 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, filters and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Newton's Cradle Loader
> A Newton's cradle where the outer balls swing out and knock the row in turn.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: pendulum, swing, physics, balls, desk toy
- Live preview: https://copy-css.com/snippets/newtons-cradle-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-cradle {
display: flex;
border-top: 2px solid #94a3b8;
}
.loader-cradle span {
position: relative;
width: 18px;
height: 56px;
transform-origin: 50% 0;
}
/* String */
.loader-cradle span::before {
content: "";
position: absolute;
top: 0;
left: 50%;
width: 1px;
height: 40px;
background: #94a3b8;
}
/* Ball */
.loader-cradle span::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 18px;
height: 18px;
border-radius: 50%;
background: radial-gradient(circle at 35% 30%, #94a3b8, #334155 60%);
}
.loader-cradle span:first-child {
animation: loader-cradle-left 1.2s infinite;
}
.loader-cradle span:last-child {
animation: loader-cradle-right 1.2s infinite;
}
@keyframes loader-cradle-left {
0% { transform: rotate(0); animation-timing-function: ease-out; }
25% { transform: rotate(35deg); animation-timing-function: ease-in; }
50%, 100% { transform: rotate(0); }
}
@keyframes loader-cradle-right {
0%, 50% { transform: rotate(0); animation-timing-function: ease-out; }
75% { transform: rotate(-35deg); animation-timing-function: ease-in; }
100% { transform: rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
.loader-cradle span:first-child,
.loader-cradle span:last-child { animation-duration: 3s; }
}
```
### Notes
- This CSS Newton's Cradle Loader is 59 lines of pure CSS (1.3 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, radial gradients and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Signal Bars Loader
> Four rising bars that light up one after another, like a phone searching for signal.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: wifi, connecting, strength, network, stagger
- Live preview: https://copy-css.com/snippets/signal-bars-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-signal {
display: flex;
align-items: flex-end;
gap: 5px;
height: 36px;
}
.loader-signal span {
width: 8px;
height: 25%;
border-radius: 2px;
background: #16a34a;
opacity: 0.2;
animation: loader-signal-light 1.6s ease-in-out infinite;
}
.loader-signal span:nth-child(2) { height: 50%; animation-delay: 0.2s; }
.loader-signal span:nth-child(3) { height: 75%; animation-delay: 0.4s; }
.loader-signal span:nth-child(4) { height: 100%; animation-delay: 0.6s; }
@keyframes loader-signal-light {
0%, 10% { opacity: 0.2; }
30%, 70% { opacity: 1; }
90%, 100% { opacity: 0.2; }
}
@media (prefers-reduced-motion: reduce) {
.loader-signal span { animation-duration: 3.2s; }
}
```
### Notes
- This CSS Signal Bars Loader is 29 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, Flexbox and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Battery Charging Loader
> A battery outline that fills up in four steps, ideal for charging or power-related loading states.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: charge, power, steps, level, energy
- Live preview: https://copy-css.com/snippets/battery-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-battery {
position: relative;
box-sizing: border-box;
width: 68px;
height: 34px;
padding: 3px;
border: 3px solid #334155;
border-radius: 7px;
}
/* Terminal */
.loader-battery::after {
content: "";
position: absolute;
top: 50%;
right: -8px;
width: 4px;
height: 12px;
border-radius: 0 2px 2px 0;
background: #334155;
transform: translateY(-50%);
}
/* Charge level */
.loader-battery::before {
content: "";
display: block;
width: 100%;
height: 100%;
border-radius: 3px;
background: #22c55e;
animation: loader-battery-charge 2.4s steps(4, jump-start) infinite;
}
@keyframes loader-battery-charge {
from { width: 0; }
to { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
.loader-battery::before { animation-duration: 5s; }
}
```
### Notes
- This CSS Battery Charging Loader is 42 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## LED Scanner Loader
> A row of LED segments with a red light sweeping back and forth, in the style of an 80s car scanner.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: scanning, sweep, segments, retro, red light, mask
- Live preview: https://copy-css.com/snippets/led-scanner-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-scanner {
width: 136px;
height: 10px;
background:
linear-gradient(90deg, #0000, #ef4444, #fca5a5, #ef4444, #0000) 0 0 / 40% 100% no-repeat,
#3b0a0a;
/* Cut the bar into 7 segments */
-webkit-mask: repeating-linear-gradient(90deg, #000 0 16px, #0000 16px 20px);
mask: repeating-linear-gradient(90deg, #000 0 16px, #0000 16px 20px);
animation: loader-scanner-sweep 1.2s ease-in-out infinite alternate;
}
@keyframes loader-scanner-sweep {
to { background-position: 100% 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
.loader-scanner { animation-duration: 3s; }
}
```
### Notes
- This CSS LED Scanner Loader is 19 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients, masks and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Writing Lines Loader
> Gradient lines that draw themselves in one after another, great for "generating response" states.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: ai, generating, text, document, typing
- Live preview: https://copy-css.com/snippets/writing-lines-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-lines {
display: grid;
gap: 9px;
width: 200px;
}
.loader-lines span {
height: 10px;
border-radius: 5px;
background: linear-gradient(90deg, #a78bfa, #60a5fa);
transform-origin: left;
animation: loader-lines-write 2.4s ease-in-out infinite;
}
.loader-lines span:nth-child(2) {
width: 85%;
animation-delay: 0.3s;
}
.loader-lines span:nth-child(3) {
width: 55%;
animation-delay: 0.6s;
}
@keyframes loader-lines-write {
0% { transform: scaleX(0); opacity: 1; }
40%, 75% { transform: scaleX(1); opacity: 1; }
100% { transform: scaleX(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
.loader-lines span { animation: none; opacity: 0.7; }
}
```
### Notes
- This CSS Writing Lines Loader is 33 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, linear gradients and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Falling Blocks Loader
> Three colored blocks that drop into place one by one, hold, then fade out and repeat.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: squares, drop, stack, tetris, stagger
- Live preview: https://copy-css.com/snippets/falling-blocks-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-blocks {
display: flex;
align-items: flex-end;
gap: 4px;
height: 64px;
}
.loader-blocks span {
width: 18px;
height: 18px;
border-radius: 4px;
background: #7c3aed;
opacity: 0;
animation: loader-blocks-drop 2s cubic-bezier(0.3, 0, 0.3, 1.4) infinite;
}
.loader-blocks span:nth-child(2) {
background: #db2777;
animation-delay: 0.2s;
}
.loader-blocks span:nth-child(3) {
background: #f59e0b;
animation-delay: 0.4s;
}
@keyframes loader-blocks-drop {
0% { transform: translateY(-46px); opacity: 0; }
20%, 70% { transform: translateY(0); opacity: 1; }
90%, 100% { transform: translateY(0); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
.loader-blocks span { animation: none; opacity: 1; }
}
```
### Notes
- This CSS Falling Blocks Loader is 35 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, Flexbox and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Top Loading Bar
> A thin glowing bar pinned to the top of the page that eases toward the end while a page loads.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: page load, nprogress, youtube, fixed, route change, glow
- Live preview: https://copy-css.com/snippets/top-loading-bar
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.top-loading-bar {
position: fixed;
top: 0;
left: 0;
z-index: 1000;
width: 0;
height: 3px;
border-radius: 0 3px 3px 0;
background: #2563eb;
box-shadow: 0 0 8px #2563eb, 0 0 2px #2563eb;
/* Fast at first, then slows to a crawl near the end. Remove the element when the load finishes. */
animation: top-loading-bar-grow 8s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
}
@keyframes top-loading-bar-grow {
0% { width: 0; }
20% { width: 45%; }
100% { width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
.top-loading-bar { animation: none; width: 60%; }
}
```
### Notes
- This CSS Top Loading Bar is 23 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, box shadows and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Styled Progress Element
> A native progress element restyled for Chrome, Safari and Firefox, with a rounded gradient fill.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: native, html5, webkit, moz, accessible, upload
- Live preview: https://copy-css.com/snippets/styled-progress-element
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.progress-native-label {
display: grid;
gap: 8px;
width: min(100%, 260px);
color: #334155;
font: 600 14px/1.2 system-ui, sans-serif;
}
.progress-native {
-webkit-appearance: none;
appearance: none;
width: 100%;
height: 10px;
overflow: hidden;
border: 0;
border-radius: 999px;
background: #e2e8f0;
}
/* Chrome, Edge, Safari */
.progress-native::-webkit-progress-bar {
border-radius: 999px;
background: #e2e8f0;
}
.progress-native::-webkit-progress-value {
border-radius: 999px;
background: linear-gradient(90deg, #06b6d4, #3b82f6);
transition: width 0.3s ease;
}
/* Firefox */
.progress-native::-moz-progress-bar {
border-radius: 999px;
background: linear-gradient(90deg, #06b6d4, #3b82f6);
}
```
### Notes
- This CSS Styled Progress Element is 36 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, linear gradients and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Liquid Fill Progress
> A round gauge that fills with gently waving water up to the value set in a custom property.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: wave, water, circle, percentage, rotating
- Live preview: https://copy-css.com/snippets/liquid-fill-progress
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
60%
```
### CSS
```css
.liquid-progress {
--progress: 50;
position: relative;
isolation: isolate;
display: grid;
place-items: center;
width: 120px;
height: 120px;
overflow: hidden;
border: 4px solid #0ea5e9;
border-radius: 50%;
background: #e0f2fe;
color: #0c4a6e;
font: 800 24px/1 system-ui, sans-serif;
}
/* Two big rotating rounded squares make the wavy surface */
.liquid-progress::before,
.liquid-progress::after {
content: "";
position: absolute;
top: calc((100 - var(--progress)) * 1% - 8px);
left: 50%;
z-index: -1;
width: 220%;
aspect-ratio: 1;
border-radius: 42%;
translate: -50% 0;
animation: liquid-progress-wave 7s linear infinite;
}
.liquid-progress::before {
background: #7dd3fc;
}
.liquid-progress::after {
top: calc((100 - var(--progress)) * 1% - 4px);
border-radius: 45%;
background: #38bdf8;
animation-duration: 10s;
}
@keyframes liquid-progress-wave {
to { rotate: 1turn; }
}
@media (prefers-reduced-motion: reduce) {
.liquid-progress::before,
.liquid-progress::after { animation: none; }
}
```
### Notes
- This CSS Liquid Fill Progress is 50 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses keyframe animations, CSS Grid, aspect-ratio and custom properties.
- Customize with: `--progress`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Labeled Progress Bar
> A determinate progress bar with a title, percentage and caption, like a storage usage meter.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: determinate, storage, usage, percentage, quota
- Live preview: https://copy-css.com/snippets/labeled-progress-bar
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Storage72%
36 GB of 50 GB used
```
### CSS
```css
.progress-labeled {
display: grid;
gap: 8px;
width: min(100%, 280px);
color: #18181b;
font: 14px/1.3 system-ui, sans-serif;
}
.progress-labeled-head {
display: flex;
justify-content: space-between;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.progress-labeled-track {
--value: 0%;
height: 8px;
overflow: hidden;
border-radius: 999px;
background: #ede9fe;
}
.progress-labeled-track::before {
content: "";
display: block;
width: var(--value);
height: 100%;
border-radius: inherit;
background: linear-gradient(90deg, #8b5cf6, #6d28d9);
transition: width 0.4s ease;
}
.progress-labeled small {
color: #71717a;
font-size: 12px;
}
```
### Notes
- This CSS Labeled Progress Bar is 37 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, linear gradients, CSS Grid and Flexbox.
- Customize with: `--value`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Segmented Progress Bar
> A progress bar split into equal blocks that fill up to a step count, for onboarding or quizzes.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: steps, blocks, onboarding, mask, custom property
- Live preview: https://copy-css.com/snippets/segmented-progress-bar
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.progress-segments {
--value: 0;
--segments: 10;
--gap: 4px;
width: min(100%, 260px);
height: 12px;
background: linear-gradient(
90deg,
#16a34a calc(var(--value) / var(--segments) * 100%),
#d1fae5 0
);
/* Cut the bar into equal blocks with gaps between them */
-webkit-mask: repeating-linear-gradient(
90deg,
#000 0 calc(100% / var(--segments) - var(--gap)),
#0000 0 calc(100% / var(--segments))
);
mask: repeating-linear-gradient(
90deg,
#000 0 calc(100% / var(--segments) - var(--gap)),
#0000 0 calc(100% / var(--segments))
);
}
```
### Notes
- This CSS Segmented Progress Bar is 23 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses linear gradients, masks and custom properties.
- Customize with: `--value`, `--segments`, `--gap`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Semicircle Gauge
> A half-circle gauge drawn with a conic gradient and a mask, showing a score from 0 to 100.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: meter, conic-gradient, dashboard, score, speedometer
- Live preview: https://copy-css.com/snippets/semicircle-gauge
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
68
```
### CSS
```css
.gauge-semi {
--value: 0;
position: relative;
display: grid;
place-items: end center;
width: 200px;
aspect-ratio: 2 / 1;
overflow: hidden;
color: #78350f;
font: 800 40px/1 system-ui, sans-serif;
}
/* A full ring, with its bottom half hidden by overflow */
.gauge-semi::before {
content: "";
position: absolute;
inset: 0 0 -100%;
border-radius: 50%;
background: conic-gradient(
from -90deg,
#f59e0b calc(var(--value) * 1.8deg),
#fde68a 0 180deg,
#0000 0
);
-webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - 22px), #000 calc(100% - 21px));
mask: radial-gradient(farthest-side, #0000 calc(100% - 22px), #000 calc(100% - 21px));
}
```
### Notes
- This CSS Semicircle Gauge is 27 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses radial gradients, conic gradients, masks and CSS Grid.
- Customize with: `--value`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Skeleton Card
> A card-shaped placeholder with an image, title and text lines, swept by a single shine layer.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: placeholder, shimmer, image, content loading, sweep
- Live preview: https://copy-css.com/snippets/skeleton-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.skel-card {
position: relative;
display: grid;
gap: 8px;
width: min(100%, 220px);
padding: 12px;
overflow: hidden;
border-radius: 16px;
background: #fff;
box-shadow: 0 2px 10px #0f172a12;
}
.skel-card-media {
aspect-ratio: 2 / 1;
border-radius: 10px;
background: #e5e7eb;
}
.skel-card-line {
height: 12px;
border-radius: 6px;
background: #e5e7eb;
}
.skel-card-title {
width: 70%;
height: 16px;
margin-top: 4px;
}
.skel-card-short {
width: 45%;
}
/* One shine layer sweeps across the whole card */
.skel-card::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(100deg, #fff0 20%, #ffffffb3 50%, #fff0 80%);
transform: translateX(-100%);
animation: skel-card-sweep 1.6s ease-in-out infinite;
}
@keyframes skel-card-sweep {
to { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
.skel-card::after { animation: none; }
}
```
### Notes
- This CSS Skeleton Card is 51 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, linear gradients and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Skeleton List
> Placeholder rows with an avatar and two text lines that pulse in a wave from top to bottom.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: placeholder, avatar, comments, rows, wave
- Live preview: https://copy-css.com/snippets/skeleton-list
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.skel-list {
display: grid;
gap: 18px;
width: min(100%, 280px);
}
.skel-list-item {
display: flex;
align-items: center;
gap: 12px;
}
.skel-list-item:nth-child(2) { --delay: 0.15s; }
.skel-list-item:nth-child(3) { --delay: 0.3s; }
.skel-list-avatar {
flex: none;
width: 44px;
height: 44px;
border-radius: 50%;
}
.skel-list-lines {
display: grid;
flex: 1;
gap: 8px;
}
.skel-list-lines::before,
.skel-list-lines::after {
content: "";
height: 12px;
border-radius: 6px;
}
.skel-list-lines::before {
width: 55%;
}
.skel-list-avatar,
.skel-list-lines::before,
.skel-list-lines::after {
background: #e2e8f0;
animation: skel-list-fade 0.9s ease-in-out infinite alternate;
animation-delay: var(--delay, 0s);
}
@keyframes skel-list-fade {
to { background: #f8fafc; }
}
@media (prefers-reduced-motion: reduce) {
.skel-list-avatar,
.skel-list-lines::before,
.skel-list-lines::after { animation: none; }
}
```
### Notes
- This CSS Skeleton List is 56 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses keyframe animations, CSS Grid, Flexbox and custom properties.
- Customize with: `--delay`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Skeleton Profile
> A profile card placeholder with cover, avatar, name and buttons that gently pulses its opacity.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: placeholder, pulse, avatar, cover, user card
- Live preview: https://copy-css.com/snippets/skeleton-profile
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.skel-profile {
width: min(100%, 250px);
padding-bottom: 18px;
overflow: hidden;
border-radius: 16px;
background: #fff;
box-shadow: 0 2px 10px #0f172a12;
animation: skel-profile-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.skel-profile-cover {
height: 56px;
background: #e2e8f0;
}
.skel-profile-avatar {
width: 64px;
height: 64px;
margin: -32px auto 0;
border: 4px solid #fff;
border-radius: 50%;
background: #cbd5e1;
}
.skel-profile-name,
.skel-profile-bio,
.skel-profile-actions span {
border-radius: 999px;
background: #e2e8f0;
}
.skel-profile-name {
width: 50%;
height: 14px;
margin: 12px auto 8px;
}
.skel-profile-bio {
width: 72%;
height: 10px;
margin: 0 auto 16px;
}
.skel-profile-actions {
display: flex;
justify-content: center;
gap: 8px;
}
.skel-profile-actions span {
width: 80px;
height: 30px;
}
@keyframes skel-profile-pulse {
50% { opacity: 0.5; }
}
@media (prefers-reduced-motion: reduce) {
.skel-profile { animation: none; }
}
```
### Notes
- This CSS Skeleton Profile is 61 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses keyframe animations, box shadows, Flexbox and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Skeleton Table
> A table placeholder with a header row and shimmering cells laid out with CSS Grid columns.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: placeholder, data grid, rows, columns, shimmer
- Live preview: https://copy-css.com/snippets/skeleton-table
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.skel-table {
width: min(100%, 300px);
overflow: hidden;
border: 1px solid #e5e7eb;
border-radius: 12px;
background: #fff;
}
.skel-table-row {
display: grid;
grid-template-columns: 2fr 1fr 1fr;
align-items: center;
gap: 16px;
padding: 14px 16px;
border-top: 1px solid #f1f5f9;
}
.skel-table span {
height: 10px;
border-radius: 5px;
background: linear-gradient(90deg, #e5e7eb 30%, #f3f4f6 50%, #e5e7eb 70%) 0 0 / 300% 100%;
animation: skel-table-shine 1.6s linear infinite;
}
.skel-table span:last-child {
width: 60%;
justify-self: end;
}
/* Header row */
.skel-table-row:first-child {
border-top: 0;
background: #f8fafc;
}
.skel-table-row:first-child span {
width: 50%;
height: 8px;
background: #cbd5e1;
animation: none;
}
@keyframes skel-table-shine {
from { background-position: 100% 0; }
to { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
.skel-table span { animation: none; }
}
```
### Notes
- This CSS Skeleton Table is 50 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients, CSS Grid and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Skeleton Image
> An image placeholder that keeps its aspect ratio and shows a photo icon under a diagonal shimmer.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: placeholder, photo, aspect-ratio, lazy loading, shimmer
- Live preview: https://copy-css.com/snippets/skeleton-image
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.skel-image {
position: relative;
width: min(100%, 280px);
aspect-ratio: 4 / 3;
overflow: hidden;
border-radius: 14px;
background: #e5e7eb;
}
/* Photo icon */
.skel-image::before {
content: "";
position: absolute;
inset: 0;
width: 48px;
height: 48px;
margin: auto;
background: #cbd5e1;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21'/%3E%3C/svg%3E") center / contain no-repeat;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21'/%3E%3C/svg%3E") center / contain no-repeat;
}
.skel-image::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(120deg, #fff0 30%, #ffffff99 50%, #fff0 70%) 0 0 / 250% 100%;
animation: skel-image-shine 1.8s ease-in-out infinite;
}
@keyframes skel-image-shine {
from { background-position: 100% 0; }
to { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
.skel-image::after { animation: none; }
}
```
### Notes
- This CSS Skeleton Image is 38 lines of pure CSS (1.4 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients, masks and aspect-ratio.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Skeleton Chat
> Chat bubble placeholders for incoming and outgoing messages that pulse while a thread loads.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: placeholder, messages, bubbles, conversation, pulse
- Live preview: https://copy-css.com/snippets/skeleton-chat
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.skel-chat {
display: grid;
gap: 10px;
width: min(100%, 280px);
}
.skel-chat-msg {
width: 55%;
height: 34px;
border-radius: 18px 18px 18px 4px;
background: #e5e7eb;
animation: skel-chat-pulse 1.4s ease-in-out infinite;
}
.skel-chat-wide {
width: 75%;
height: 52px;
animation-delay: 0.15s;
}
/* Outgoing message */
.skel-chat-me {
justify-self: end;
width: 45%;
border-radius: 18px 18px 4px 18px;
background: #c7d2fe;
animation-delay: 0.3s;
}
.skel-chat-msg:last-child {
width: 35%;
animation-delay: 0.45s;
}
@keyframes skel-chat-pulse {
50% { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
.skel-chat-msg { animation: none; }
}
```
### Notes
- This CSS Skeleton Chat is 41 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, CSS Grid and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Radar Loader
> A green radar screen with range rings, a rotating sweep and a blip that lights up as it passes.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: sweep, scanning, conic-gradient, searching, sonar
- Live preview: https://copy-css.com/snippets/radar-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-radar {
position: relative;
width: 100px;
height: 100px;
overflow: hidden;
border: 2px solid #22c55e80;
border-radius: 50%;
background:
repeating-radial-gradient(#0000 0 15px, #22c55e4d 15px 16px),
linear-gradient(#22c55e33, #22c55e33) center / 1px 100% no-repeat,
linear-gradient(#22c55e33, #22c55e33) center / 100% 1px no-repeat,
#052e16;
}
/* Sweep */
.loader-radar::before {
content: "";
position: absolute;
inset: 0;
border-radius: 50%;
background: conic-gradient(#22c55e00 0 70%, #22c55eaa);
animation: loader-radar-sweep 2s linear infinite;
}
/* Blip */
.loader-radar::after {
content: "";
position: absolute;
top: 26%;
left: 64%;
width: 6px;
height: 6px;
border-radius: 50%;
background: #86efac;
box-shadow: 0 0 8px #4ade80;
opacity: 0;
animation: loader-radar-blip 2s linear infinite;
}
@keyframes loader-radar-sweep {
to { transform: rotate(1turn); }
}
@keyframes loader-radar-blip {
0%, 8% { opacity: 0; }
10% { opacity: 1; }
70%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
.loader-radar::before,
.loader-radar::after { animation-duration: 5s; }
}
```
### Notes
- This CSS Radar Loader is 53 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, linear gradients and radial gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Breathing Orb Loader
> A glowing purple orb that slowly breathes in and out, a calm "thinking" state for AI assistants.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: ai, thinking, glow, calm, scale, pulse
- Live preview: https://copy-css.com/snippets/breathing-orb-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-orb {
width: 64px;
height: 64px;
border-radius: 50%;
background: radial-gradient(circle at 35% 30%, #f3e8ff, #a855f7 45%, #6d28d9);
box-shadow:
0 0 24px #a855f766,
0 0 48px #6366f133;
animation: loader-orb-breathe 3s ease-in-out infinite;
}
@keyframes loader-orb-breathe {
50% {
transform: scale(1.18);
box-shadow:
0 0 36px #a855f799,
0 0 80px #6366f155;
}
}
@media (prefers-reduced-motion: reduce) {
.loader-orb { animation: none; }
}
```
### Notes
- This CSS Breathing Orb Loader is 23 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, radial gradients and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Double Bounce Loader
> Two translucent circles that grow and shrink in turn, overlapping into a soft pulsing blob.
- Category: [CSS Loaders & Spinners](https://copy-css.com/category/loaders)
- Tags: pulse, circles, scale, overlapping, spinkit
- Live preview: https://copy-css.com/snippets/double-bounce-loader
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.loader-double {
position: relative;
width: 56px;
height: 56px;
}
.loader-double::before,
.loader-double::after {
content: "";
position: absolute;
inset: 0;
border-radius: 50%;
background: #14b8a6;
opacity: 0.6;
animation: loader-double-bounce 2s ease-in-out infinite;
}
.loader-double::after {
animation-delay: -1s;
}
@keyframes loader-double-bounce {
0%, 100% { transform: scale(0); }
50% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
.loader-double::before,
.loader-double::after { animation-duration: 4s; }
}
```
### Notes
- This CSS Double Bounce Loader is 30 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
# CSS Text Effects
Gradient text, neon glows, outlines, typewriters and animated underlines.
## Gradient Text
> Headline text filled with a gradient using background-clip: text.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: gradient, heading, background-clip, colorful
- Live preview: https://copy-css.com/snippets/gradient-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Make it pop
```
### CSS
```css
.text-gradient {
margin: 0;
font: 800 44px/1.1 system-ui, sans-serif;
background: linear-gradient(90deg, #f97316, #ec4899, #8b5cf6);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
```
### Notes
- This CSS Gradient Text is 8 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses linear gradients and gradient-clipped text.
- gradient-clipped text: Includes the -webkit- prefix Safari still needs.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Neon Text
> Glowing neon sign text with a subtle flicker, built with text-shadow.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: neon, glow, text-shadow, flicker, dark
- Live preview: https://copy-css.com/snippets/neon-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Open late
```
### CSS
```css
.text-neon {
margin: 0;
font: 700 42px/1 system-ui, sans-serif;
color: #ecfeff;
text-shadow:
0 0 4px #fff,
0 0 12px #22d3ee,
0 0 28px #22d3ee,
0 0 56px #0891b2;
animation: flicker 3s infinite;
}
@keyframes flicker {
0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
20%, 24%, 55% { opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) {
.text-neon {
animation: none;
}
}
```
### Notes
- This CSS Neon Text is 22 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses keyframe animations, text shadows and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Outline Text
> Hollow outlined headline text that fills in solid on hover.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: outline, stroke, hollow, heading
- Live preview: https://copy-css.com/snippets/outline-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
OUTLINE
```
### CSS
```css
.text-outline {
margin: 0;
font: 900 52px/1 system-ui, sans-serif;
letter-spacing: 0.02em;
color: transparent;
-webkit-text-stroke: 2px #111;
transition: color 0.3s ease;
}
.text-outline:hover {
color: #111;
}
```
### Notes
- This CSS Outline Text is 12 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses transitions.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Typewriter Text
> Text that types itself out with a blinking caret, using only CSS.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: typewriter, typing, animation, caret, monospace
- Live preview: https://copy-css.com/snippets/typewriter-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Hello, world!
```
### CSS
```css
/* Set width and steps() to the number of characters */
.typewriter {
width: 13ch;
margin: 0;
overflow: hidden;
white-space: nowrap;
border-right: 3px solid #111;
font: 600 24px/1.3 ui-monospace, Menlo, monospace;
animation:
typewriter-type 2.5s steps(13) infinite alternate,
typewriter-caret 0.7s step-end infinite;
}
@keyframes typewriter-type {
from { width: 0; }
}
@keyframes typewriter-caret {
50% { border-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
.typewriter {
animation: none;
}
}
```
### Notes
- This CSS Typewriter Text is 26 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Animated Underline
> A link underline that draws in from the left and exits to the right.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: link, underline, hover, navigation
- Live preview: https://copy-css.com/snippets/underline-link
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Read the docs
```
### CSS
```css
.link-underline {
position: relative;
color: #111;
font: 600 22px/1.4 system-ui, sans-serif;
text-decoration: none;
}
.link-underline::after {
content: "";
position: absolute;
left: 0;
bottom: -2px;
width: 100%;
height: 2px;
background: currentColor;
transform: scaleX(0);
transform-origin: right;
transition: transform 0.3s ease;
}
.link-underline:hover::after {
transform: scaleX(1);
transform-origin: left;
}
```
### Notes
- This CSS Animated Underline is 24 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.
## Marker Highlight
> A hand-drawn style highlighter stroke behind important words.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: highlight, marker, emphasis, gradient
- Live preview: https://copy-css.com/snippets/marker-highlight
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Copy. Paste. Ship it.
```
### CSS
```css
.text-marker {
margin: 0;
color: #111;
font: 700 30px/1.3 system-ui, sans-serif;
}
.text-marker span {
padding: 0 4px;
background: linear-gradient(transparent 55%, #fde047 55%);
}
```
### Notes
- This CSS Marker Highlight is 10 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses linear gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## 3D Text
> Bold extruded 3D lettering built from stacked text shadows.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: 3d, text-shadow, extruded, retro, heading
- Live preview: https://copy-css.com/snippets/3d-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
POP!
```
### CSS
```css
.text-3d {
margin: 0;
color: #fde047;
font: 900 54px/1 system-ui, sans-serif;
letter-spacing: 0.02em;
text-shadow:
1px 1px 0 #f43f5e,
2px 2px 0 #f43f5e,
3px 3px 0 #f43f5e,
4px 4px 0 #f43f5e,
5px 5px 0 #f43f5e,
6px 6px 0 #e11d48,
8px 10px 16px rgba(0, 0, 0, 0.4);
}
```
### Notes
- This CSS 3D Text is 14 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses text shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Glitch Text
> A cyberpunk glitch effect with offset red and cyan slices.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: glitch, cyberpunk, clip-path, animation, dark
- Live preview: https://copy-css.com/snippets/glitch-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
GLITCH
```
### CSS
```css
.glitch {
position: relative;
margin: 0;
color: #fff;
font: 900 52px/1 system-ui, sans-serif;
letter-spacing: 0.04em;
}
.glitch::before,
.glitch::after {
content: attr(data-text);
position: absolute;
top: 0;
width: 100%;
background: #0f0f12; /* match your page background */
}
.glitch::before {
left: 2px;
text-shadow: -2px 0 #f43f5e;
animation: glitch-a 2.5s infinite linear alternate-reverse;
}
.glitch::after {
left: -2px;
text-shadow: 2px 0 #22d3ee;
animation: glitch-b 3s infinite linear alternate-reverse;
}
@keyframes glitch-a {
0% { clip-path: inset(10% 0 80% 0); }
20% { clip-path: inset(60% 0 20% 0); }
40% { clip-path: inset(30% 0 50% 0); }
60% { clip-path: inset(80% 0 5% 0); }
80% { clip-path: inset(15% 0 70% 0); }
100% { clip-path: inset(45% 0 40% 0); }
}
@keyframes glitch-b {
0% { clip-path: inset(70% 0 10% 0); }
25% { clip-path: inset(20% 0 65% 0); }
50% { clip-path: inset(50% 0 30% 0); }
75% { clip-path: inset(5% 0 85% 0); }
100% { clip-path: inset(85% 0 2% 0); }
}
@media (prefers-reduced-motion: reduce) {
.glitch::before,
.glitch::after {
display: none;
}
}
```
### Notes
- This CSS Glitch Text is 52 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses keyframe animations, text shadows, clip paths and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Shimmer Text
> A beam of light that sweeps across the text on a loop.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: shimmer, shine, gradient, background-clip, animation
- Live preview: https://copy-css.com/snippets/shimmer-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Coming soon
```
### CSS
```css
.text-shimmer {
margin: 0;
font: 800 36px/1.1 system-ui, sans-serif;
background: linear-gradient(90deg, #64748b 0%, #64748b 40%, #f8fafc 50%, #64748b 60%, #64748b 100%);
background-size: 200% 100%;
-webkit-background-clip: text;
background-clip: text;
color: transparent;
animation: text-shimmer 2.4s linear infinite;
}
@keyframes text-shimmer {
from { background-position: 150% 0; }
to { background-position: -50% 0; }
}
@media (prefers-reduced-motion: reduce) {
.text-shimmer {
animation: none;
}
}
```
### Notes
- This CSS Shimmer Text is 21 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients, gradient-clipped text and reduced-motion support.
- gradient-clipped text: Includes the -webkit- prefix Safari still needs.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Rotating Words
> A headline where one word cycles through options. Pure CSS, no JavaScript.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: rotate, words, headline, animation, hero
- Live preview: https://copy-css.com/snippets/rotating-words
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Build fasterbetterbolder
```
### CSS
```css
.rotator {
display: flex;
gap: 0.3em;
margin: 0;
color: #111;
font: 700 32px/1.2 system-ui, sans-serif;
}
.rotator span {
display: inline-flex;
flex-direction: column;
height: 1.2em;
overflow: hidden;
}
.rotator b {
color: #7c3aed;
animation: rotate-words 6s infinite;
}
@keyframes rotate-words {
0%, 28% { transform: translateY(0); }
33%, 61% { transform: translateY(-100%); }
66%, 94% { transform: translateY(-200%); }
100% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
.rotator b {
animation: none;
}
}
```
### Notes
- This CSS Rotating Words is 32 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, Flexbox and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Wavy Underline
> A playful squiggly underline using modern text-decoration properties.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: underline, wavy, text-decoration, emphasis
- Live preview: https://copy-css.com/snippets/wavy-underline
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
This is really important.
```
### CSS
```css
.wavy {
margin: 0;
color: #111;
font: 600 26px/1.5 system-ui, sans-serif;
}
.wavy span {
text-decoration: underline wavy #f43f5e;
text-decoration-thickness: 2px;
text-underline-offset: 6px;
}
```
### Notes
- This CSS Wavy Underline is 11 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Drop Cap
> A classic editorial drop cap using the ::first-letter pseudo-element.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: drop cap, first-letter, editorial, typography, blog
- Live preview: https://copy-css.com/snippets/drop-cap
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Once upon a time, a single line of CSS turned a plain paragraph into something worth reading.
```
### CSS
```css
.drop-cap {
max-width: 260px;
margin: 0;
color: #374151;
font: 15px/1.6 Georgia, serif;
}
.drop-cap::first-letter {
float: left;
margin: 4px 8px 0 0;
color: #b45309;
font: 700 3.6em/0.8 Georgia, serif;
}
```
### Notes
- This CSS Drop Cap is 13 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Long Shadow Text
> A flat-design long shadow that trails diagonally off the letters.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: long shadow, flat, text-shadow, retro, heading
- Live preview: https://copy-css.com/snippets/long-shadow-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Hello
```
### CSS
```css
.long-shadow {
margin: 0;
color: #fff;
font: 900 60px/1 system-ui, sans-serif;
text-shadow:
1px 1px #0f766e, 2px 2px #0f766e, 3px 3px #0f766e,
4px 4px #0f766e, 5px 5px #0f766e, 6px 6px #0f766e,
7px 7px #0f766e, 8px 8px #0f766e, 9px 9px #0f766e,
10px 10px #0f766e, 11px 11px #0f766e, 12px 12px #0f766e;
}
```
### Notes
- This CSS Long Shadow Text is 10 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses text shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Letterpress Text
> Text that looks pressed into the surface, using a light highlight below each letter.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: letterpress, emboss, inset, text-shadow, subtle
- Live preview: https://copy-css.com/snippets/letterpress-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Pressed
```
### CSS
```css
.letterpress {
margin: 0;
color: #78716c;
font: 800 54px/1 system-ui, sans-serif;
text-shadow:
0 1px 0 rgba(255, 255, 255, 0.6),
0 -1px 0 rgba(0, 0, 0, 0.15);
}
```
### Notes
- This CSS Letterpress Text is 8 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses text shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Fill on Hover Text
> Outlined text that fills with solid color from left to right on hover.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: outline, hover, fill, background-clip, link
- Live preview: https://copy-css.com/snippets/fill-on-hover-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Portfolio
```
### CSS
```css
.text-fill {
color: transparent;
font: 900 52px/1.1 system-ui, sans-serif;
text-decoration: none;
-webkit-text-stroke: 1.5px #fafafa;
background: linear-gradient(#a3e635, #a3e635) left / 0% 100% no-repeat;
-webkit-background-clip: text;
background-clip: text;
transition: background-size 0.45s ease;
}
.text-fill:hover,
.text-fill:focus-visible {
background-size: 100% 100%;
}
```
### Notes
- This CSS Fill on Hover Text is 15 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses transitions, linear gradients, gradient-clipped text and keyboard focus styles.
- gradient-clipped text: Includes the -webkit- prefix Safari still needs.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Balanced Headline
> Evens out the line lengths of headings and avoids lonely last words in paragraphs.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: text-wrap, balance, pretty, typography, orphans
- Live preview: https://copy-css.com/snippets/balanced-headline
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Ship faster with tiny, reusable CSS building blocks
Short paragraphs look better without a single word stranded on the last line.
```
### CSS
```css
/* Headings: balance line lengths */
.balanced h1,
.balanced h2,
.balanced h3 {
text-wrap: balance;
}
/* Body text: avoid a single word on the last line */
.balanced p {
text-wrap: pretty;
}
```
### Notes
- This CSS Balanced Headline is 11 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses balanced text wrapping.
- balanced text wrapping: Chrome 114+, Safari 17.5+, Firefox 121+. Other browsers wrap normally.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Multi-line Truncate
> Cut text off after a set number of lines and end it with an ellipsis.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: line-clamp, truncate, ellipsis, overflow, excerpt
- Live preview: https://copy-css.com/snippets/line-clamp
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
CSS can trim long text to a set number of lines and add an ellipsis at the end. There is no JavaScript and no measuring, and it keeps working as the container resizes.
```
### CSS
```css
.clamp {
--lines: 3;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: var(--lines);
line-clamp: var(--lines);
overflow: hidden;
}
```
### Notes
- This CSS Multi-line Truncate is 8 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses line clamping and custom properties.
- Customize with: `--lines`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Fancy Blockquote
> A pull quote with an accent bar, a big decorative quote mark and a styled citation.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: blockquote, quote, pull quote, serif, cite
- Live preview: https://copy-css.com/snippets/fancy-blockquote
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Ship small, ship often, and let real people tell you what matters.
The product handbook
```
### CSS
```css
.quote {
position: relative;
margin: 0;
padding: 18px 22px 18px 24px;
border-left: 4px solid #f59e0b;
border-radius: 4px 12px 12px 4px;
background: #fffbeb;
}
.quote::before {
content: "\201C";
position: absolute;
top: -14px;
right: 14px;
color: #fcd34d;
font: 700 72px/1 Georgia, serif;
}
.quote p {
position: relative;
margin: 0 0 10px;
color: #451a03;
font: italic 17px/1.45 Georgia, "Times New Roman", serif;
}
.quote cite {
color: #b45309;
font: normal 600 13px system-ui, sans-serif;
}
.quote cite::before {
content: "— ";
}
```
### Notes
- This CSS Fancy Blockquote is 33 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Line Reveal
> A headline whose lines slide up from behind an invisible mask, one after another.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: reveal, slide up, headline, mask, entrance, animation
- Live preview: https://copy-css.com/snippets/text-reveal
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Design thatfeels effortless
```
### CSS
```css
.reveal {
margin: 0;
color: #0f172a;
font: 800 30px/1.15 system-ui, sans-serif;
}
/* Each line clips its own text */
.reveal > span {
display: block;
overflow: hidden;
}
.reveal > span > span {
display: block;
animation: reveal-up 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.reveal > span:nth-child(2) > span {
animation-delay: 0.12s;
}
@keyframes reveal-up {
from { transform: translateY(110%); }
}
@media (prefers-reduced-motion: reduce) {
.reveal > span > span { animation: none; }
}
```
### Notes
- This CSS Line Reveal is 28 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Rotating Circular Text
> Text set around a circle with SVG textPath, slowly spinning around a center icon.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: circle, textPath, svg, rotate, badge, scroll
- Live preview: https://copy-css.com/snippets/circular-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
↓
```
### CSS
```css
.circle-text {
position: relative;
display: grid;
place-items: center;
width: 120px;
height: 120px;
text-decoration: none;
}
.circle-text svg {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
animation: circle-spin 12s linear infinite;
}
.circle-text path {
fill: none;
}
.circle-text text {
fill: #1c1917;
font: 700 10px system-ui, sans-serif;
}
.circle-text span {
display: grid;
place-items: center;
width: 44px;
height: 44px;
border-radius: 50%;
background: #1c1917;
color: #fef3c7;
font: 700 20px system-ui, sans-serif;
}
.circle-text:focus-visible {
border-radius: 50%;
outline: 2px solid #1c1917;
outline-offset: 4px;
}
@keyframes circle-spin {
to { transform: rotate(1turn); }
}
@media (prefers-reduced-motion: reduce) {
.circle-text svg { animation: none; }
}
```
### Notes
- This CSS Rotating Circular Text is 50 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, CSS Grid and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Animated Gradient Text
> Headline text filled with a multi-color gradient that flows across the letters on a loop.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: flowing, background-clip, colorful, hero, loop
- Live preview: https://copy-css.com/snippets/animated-gradient-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Go further
```
### CSS
```css
.text-flow {
margin: 0;
font: 800 44px/1.1 system-ui, sans-serif;
background: linear-gradient(90deg, #06b6d4, #8b5cf6, #ec4899, #f59e0b, #06b6d4);
background-size: 200% 100%;
-webkit-background-clip: text;
background-clip: text;
color: transparent;
animation: text-flow-move 5s linear infinite;
}
@keyframes text-flow-move {
to { background-position: 200% 0; }
}
@media (prefers-reduced-motion: reduce) {
.text-flow { animation: none; }
}
```
### Notes
- This CSS Animated Gradient Text is 18 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients, gradient-clipped text and reduced-motion support.
- gradient-clipped text: Includes the -webkit- prefix Safari still needs.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Gradient Underline Link
> A link with a thin gradient underline that grows into a full highlight on hover, even across lines.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: link, hover, background-size, fill, multi-line
- Live preview: https://copy-css.com/snippets/gradient-underline-link
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.link-grad-text {
max-width: 15em;
margin: 0;
color: #334155;
font: 500 20px/1.6 system-ui, sans-serif;
}
.link-grad {
padding: 0 0.1em;
color: #312e81;
font-weight: 700;
text-decoration: none;
background: linear-gradient(90deg, #4f46e5, #db2777) no-repeat left bottom / 100% 3px;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
transition: background-size 0.3s ease, color 0.3s ease;
}
.link-grad:hover,
.link-grad:focus-visible {
background-size: 100% 100%;
color: #ffffff;
}
.link-grad:focus-visible {
outline: 2px solid #312e81;
outline-offset: 2px;
}
```
### Notes
- This CSS Gradient Underline Link is 28 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, linear gradients and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Striped Text
> Bold display text filled with 70s-style horizontal stripes using a repeating gradient clip.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: stripes, pattern, retro, 70s, background-clip
- Live preview: https://copy-css.com/snippets/striped-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
RETRO
```
### CSS
```css
.text-stripes {
margin: 0;
font: 900 60px/1 system-ui, sans-serif;
letter-spacing: 0.02em;
background: repeating-linear-gradient(
180deg,
#dc2626 0 5px,
#f97316 5px 10px,
#facc15 10px 15px
);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
```
### Notes
- This CSS Striped Text is 14 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses linear gradients and gradient-clipped text.
- gradient-clipped text: Includes the -webkit- prefix Safari still needs.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Two-Tone Text
> Headline text split into two flat colors at a hard gradient stop, like a horizon line.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: split, hard stop, two color, background-clip, headline
- Live preview: https://copy-css.com/snippets/two-tone-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Horizon
```
### CSS
```css
.text-two-tone {
--top: #0284c7;
--bottom: #0f172a;
--split: 55%;
margin: 0;
font: 900 52px/1 system-ui, sans-serif;
background: linear-gradient(var(--top) var(--split), var(--bottom) var(--split));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
```
### Notes
- This CSS Two-Tone Text is 11 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses linear gradients, gradient-clipped text and custom properties.
- gradient-clipped text: Includes the -webkit- prefix Safari still needs.
- Customize with: `--top`, `--bottom`, `--split`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Gradient Outline Text
> Hollow headline text with a gradient outline, made from a transparent stroke over a clipped gradient.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: stroke, hollow, text-stroke, background-clip, heading
- Live preview: https://copy-css.com/snippets/gradient-outline-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
HOLLOW
```
### CSS
```css
/* --fill must match the background behind the text */
.text-grad-stroke {
--fill: #ffffff;
margin: 0;
font: 900 48px/1 system-ui, sans-serif;
letter-spacing: 0.03em;
background: linear-gradient(90deg, #f97316, #db2777, #7c3aed);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: var(--fill);
-webkit-text-stroke: 4px transparent;
}
```
### Notes
- This CSS Gradient Outline Text is 12 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses linear gradients, gradient-clipped text and custom properties.
- gradient-clipped text: Includes the -webkit- prefix Safari still needs.
- Customize with: `--fill`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Sticker Text
> Chunky cartoon text with a thick outline behind the fill and a hard drop shadow, like a sticker.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: outline, thick stroke, paint-order, cartoon, playful
- Live preview: https://copy-css.com/snippets/sticker-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Hooray!
```
### CSS
```css
.text-sticker {
--fill: #facc15;
--ink: #1e1b4b;
margin: 0;
font: 900 48px/1.1 system-ui, sans-serif;
letter-spacing: 0.03em;
color: var(--fill);
-webkit-text-stroke: 10px var(--ink);
paint-order: stroke fill;
text-shadow: 5px 6px 0 var(--ink);
transform: rotate(-4deg);
}
```
### Notes
- This CSS Sticker Text is 12 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses transforms, text shadows and custom properties.
- Customize with: `--fill`, `--ink`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Echo Outline Text
> A bold word followed by fading outlined copies of itself, a stacked poster-style echo.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: outline, repeat, stacked, text-stroke, poster
- Live preview: https://copy-css.com/snippets/echo-outline-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
ECHOECHOECHO
```
### CSS
```css
.text-echo {
display: grid;
margin: 0;
color: #a3e635;
font: 900 46px/0.85 system-ui, sans-serif;
letter-spacing: 0.04em;
}
.text-echo span + span {
color: transparent;
-webkit-text-stroke: 1.5px #a3e635;
}
.text-echo span:nth-child(2) {
opacity: 0.6;
}
.text-echo span:nth-child(3) {
opacity: 0.3;
}
```
### Notes
- This CSS Echo Outline Text is 20 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Stroke Drawing Text
> SVG text whose outline draws itself in with stroke-dasharray, then fills in with color.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: svg, stroke-dasharray, line drawing, outline, handwriting
- Live preview: https://copy-css.com/snippets/stroke-draw-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.text-draw {
width: 260px;
max-width: 100%;
height: auto;
}
.text-draw text {
font: 800 72px system-ui, sans-serif;
fill: transparent;
stroke: #0f766e;
stroke-width: 1.5px;
stroke-dasharray: 360;
stroke-dashoffset: 360;
animation:
text-draw-line 2.4s ease-in-out forwards,
text-draw-fill 0.6s 2.2s ease forwards;
}
@keyframes text-draw-line {
to { stroke-dashoffset: 0; }
}
@keyframes text-draw-fill {
to { fill: #0f766e; }
}
@media (prefers-reduced-motion: reduce) {
.text-draw text {
animation: none;
fill: #0f766e;
stroke-dashoffset: 0;
}
}
```
### Notes
- This CSS Stroke Drawing Text is 33 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## RGB Split Text
> Chromatic aberration text with red and cyan channels pulled apart and an occasional jitter.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: glitch, chromatic aberration, text-shadow, cyberpunk, anaglyph
- Live preview: https://copy-css.com/snippets/rgb-split-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
SIGNAL
```
### CSS
```css
.text-rgb {
--shift: 3px;
margin: 0;
color: #fafafa;
font: 900 44px/1 system-ui, sans-serif;
letter-spacing: 0.06em;
text-shadow:
calc(var(--shift) * -1) 0 #ff004c,
var(--shift) 0 #00e5ff;
animation: text-rgb-jitter 3s steps(1) infinite;
}
@keyframes text-rgb-jitter {
0%, 100% { transform: none; }
90% { transform: translateX(-2px) skewX(6deg); }
93% { transform: translateX(3px); }
96% { transform: translateX(-1px) skewX(-4deg); }
}
@media (prefers-reduced-motion: reduce) {
.text-rgb { animation: none; }
}
```
### Notes
- This CSS RGB Split Text is 22 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, text shadows and custom properties.
- Customize with: `--shift`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Glitch Hover Link
> A monospace link that stutters with skew and color-split jumps only while hovered or focused.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: glitch, hover, skew, cyberpunk, monospace
- Live preview: https://copy-css.com/snippets/glitch-hover-link
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
ENTER_
```
### CSS
```css
.glitch-link {
display: inline-block;
color: #e4e4e7;
font: 700 32px/1 ui-monospace, Menlo, monospace;
letter-spacing: 0.08em;
text-decoration: none;
}
.glitch-link:hover,
.glitch-link:focus-visible {
color: #ffffff;
text-shadow: 2px 0 #ff00c8, -2px 0 #00f0ff;
animation: glitch-link-jump 0.5s steps(1) infinite;
}
.glitch-link:focus-visible {
outline: 2px solid #22d3ee;
outline-offset: 6px;
}
@keyframes glitch-link-jump {
20% {
transform: translate(-3px, 1px) skewX(10deg);
text-shadow: -3px 0 #ff00c8, 3px 0 #00f0ff;
}
40% { transform: translate(2px, -1px); }
60% {
transform: skewX(-8deg);
text-shadow: 3px 1px #ff00c8, -3px -1px #00f0ff;
}
80% { transform: translate(1px, 2px); }
}
@media (prefers-reduced-motion: reduce) {
.glitch-link:hover,
.glitch-link:focus-visible { animation: none; }
}
```
### Notes
- This CSS Glitch Hover Link is 37 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, text shadows and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## VHS Text
> Retro VHS screen text with scanlines, a soft color bleed and a bright tracking band rolling down.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: retro, scanlines, glitch, tape, 80s
- Live preview: https://copy-css.com/snippets/vhs-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
PLAY ▶
```
### CSS
```css
.text-vhs {
position: relative;
margin: 0;
padding: 8px 14px;
overflow: hidden;
color: #f8fafc;
font: 700 40px/1 ui-monospace, Menlo, monospace;
letter-spacing: 0.1em;
text-shadow:
2px 0 #ff2d5599,
-2px 0 #22d3ee99,
0 0 10px #ffffff66;
animation: text-vhs-jitter 4s steps(1) infinite;
}
/* Scanlines plus a bright band that rolls down */
.text-vhs::after {
content: "";
position: absolute;
inset: 0;
background:
linear-gradient(#ffffff00 42%, #ffffff2e 50%, #ffffff00 58%) 0 0 / 100% 300% no-repeat,
repeating-linear-gradient(#00000000 0 2px, #00000059 2px 4px);
animation: text-vhs-roll 3s linear infinite;
pointer-events: none;
}
@keyframes text-vhs-jitter {
0%, 100% { transform: none; }
50% { transform: translateX(2px); }
52% { transform: translateX(-3px) skewX(-6deg); }
54% { transform: none; }
}
@keyframes text-vhs-roll {
from { background-position: 0 100%, 0 0; }
to { background-position: 0 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
.text-vhs,
.text-vhs::after { animation: none; }
}
```
### Notes
- This CSS VHS Text is 43 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, linear gradients and text shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Sliced Text Hover
> A word cut diagonally in two with clip-path, the halves sliding apart on hover or focus.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: glitch, slice, clip-path, split, link
- Live preview: https://copy-css.com/snippets/sliced-text-hover
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
SLICESLICE
```
### CSS
```css
.text-slice {
display: inline-grid;
color: #18181b;
font: 900 52px/1 system-ui, sans-serif;
letter-spacing: 0.02em;
text-decoration: none;
}
.text-slice span {
grid-area: 1 / 1;
transition: transform 0.35s cubic-bezier(0.3, 0.7, 0.2, 1), color 0.35s ease;
}
.text-slice span:first-child {
clip-path: polygon(0 0, 100% 0, 100% 40%, 0 62%);
}
.text-slice span:last-child {
clip-path: polygon(0 62%, 100% 40%, 100% 100%, 0 100%);
}
.text-slice:hover span:first-child,
.text-slice:focus-visible span:first-child {
transform: translate(-6px, -2px);
}
.text-slice:hover span:last-child,
.text-slice:focus-visible span:last-child {
color: #e11d48;
transform: translate(6px, 2px);
}
.text-slice:focus-visible {
outline: 2px solid #18181b;
outline-offset: 8px;
}
@media (prefers-reduced-motion: reduce) {
.text-slice span { transition: color 0.35s ease; }
}
```
### Notes
- This CSS Sliced Text Hover is 40 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, transforms, clip paths and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Multi-line Typewriter
> Two lines of monospace text typed out one after the other, with the caret moving down a line.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: typing, two lines, caret, steps, monospace, hero
- Live preview: https://copy-css.com/snippets/multiline-typewriter
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Design faster.Ship sooner.
```
### CSS
```css
/* Set --n on each line to its number of characters */
.tw-lines {
margin: 0;
color: #1c1917;
font: 600 22px/1.5 ui-monospace, Menlo, monospace;
}
.tw-lines span {
display: block;
width: calc(var(--n) * 1ch);
overflow: hidden;
white-space: nowrap;
border-right: 0.12em solid transparent;
}
.tw-lines span:first-child {
--n: 14;
animation:
tw-lines-type 1.4s steps(14) both,
tw-lines-blink 0.7s step-end 2;
}
.tw-lines span:last-child {
--n: 12;
animation:
tw-lines-type 1.2s 1.6s steps(12) both,
tw-lines-blink 0.8s 1.4s step-end infinite;
}
@keyframes tw-lines-type {
from { width: 0; }
}
@keyframes tw-lines-blink {
from { border-right-color: currentColor; }
50% { border-right-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
.tw-lines span { animation: none; }
}
```
### Notes
- This CSS Multi-line Typewriter is 41 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses keyframe animations, custom properties and reduced-motion support.
- Customize with: `--n`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Typewriter Word Loop
> A headline that types and deletes a list of words in turn, with a blinking caret and no JavaScript.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: typing, rotating words, hero, headline, caret, steps
- Live preview: https://copy-css.com/snippets/typewriter-word-loop
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Make it
fastsimpleyours
```
### CSS
```css
/* --n is each word's character count. 3 words x 3s each = 9s */
.tw-loop {
margin: 0;
color: #3b0764;
font: 700 28px/1.3 ui-monospace, Menlo, monospace;
}
.tw-loop-words {
display: inline-grid;
vertical-align: bottom;
color: #c026d3;
border-right: 0.1em solid;
animation: tw-loop-blink 0.8s step-end infinite;
}
.tw-loop-words span {
grid-area: 1 / 1;
width: 0;
overflow: hidden;
white-space: nowrap;
animation: tw-loop-type 9s steps(var(--n)) infinite;
}
.tw-loop-words span:nth-child(2) {
animation-delay: 3s;
}
.tw-loop-words span:nth-child(3) {
animation-delay: 6s;
}
@keyframes tw-loop-type {
0% { width: 0; }
12%, 24% { width: calc(var(--n) * 1ch); }
33%, 100% { width: 0; }
}
@keyframes tw-loop-blink {
50% { border-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
.tw-loop-words,
.tw-loop-words span { animation: none; }
.tw-loop-words span:first-child { width: auto; }
}
```
### Notes
- This CSS Typewriter Word Loop is 47 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses keyframe animations, CSS Grid, custom properties and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Terminal Typing
> A dark terminal window that types a command with a block caret, then prints the output line.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: command line, typing, block caret, developer, code, shell
- Live preview: https://copy-css.com/snippets/terminal-typing
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
npm i copycss
added 1 package in 0.4s
```
### CSS
```css
.term-typing {
box-sizing: border-box;
width: 250px;
max-width: 100%;
padding: 16px 18px;
border-radius: 10px;
background: #0f172a;
color: #e2e8f0;
font: 500 14px/1.7 ui-monospace, Menlo, monospace;
box-shadow: 0 12px 30px #0f172a40;
}
.term-typing p {
margin: 0;
}
.term-typing-line::before {
content: "$ ";
color: #4ade80;
}
/* Width in ch = number of characters in the command */
.term-typing-cmd {
display: inline-block;
width: 13ch;
overflow: hidden;
white-space: nowrap;
vertical-align: bottom;
animation: term-typing-type 1.3s 0.4s steps(13) both;
}
.term-typing-line::after {
content: "";
display: inline-block;
width: 0.6em;
height: 1.15em;
vertical-align: -0.2em;
background: #4ade80;
animation: term-typing-blink 1s step-end infinite;
}
.term-typing-out {
color: #94a3b8;
animation: term-typing-show 0.2s 2s both;
}
@keyframes term-typing-type {
from { width: 0; }
}
@keyframes term-typing-blink {
50% { opacity: 0; }
}
@keyframes term-typing-show {
from { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
.term-typing-cmd,
.term-typing-out,
.term-typing-line::after { animation: none; }
}
```
### Notes
- This CSS Terminal Typing is 63 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses keyframe animations, box shadows and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Blinking Text Cursor
> A thin blinking caret after any heading or line of text, sized in em so it scales with the font.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: caret, blink, hero, terminal, pseudo-element
- Live preview: https://copy-css.com/snippets/blinking-cursor-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Hi, I build websites
```
### CSS
```css
.text-cursor {
max-width: 11em;
margin: 0;
color: #0f172a;
font: 800 30px/1.2 system-ui, sans-serif;
}
.text-cursor::after {
content: "";
display: inline-block;
width: 0.08em;
height: 1em;
margin-left: 0.1em;
vertical-align: -0.12em;
background: #2563eb;
animation: text-cursor-blink 1s step-end infinite;
}
@keyframes text-cursor-blink {
50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
.text-cursor::after { animation: none; }
}
```
### Notes
- This CSS Blinking Text Cursor is 25 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Highlight Sweep
> A marker highlight that sweeps in behind key words from left to right when the page loads.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: marker, mark, animation, emphasis, background-size
- Live preview: https://copy-css.com/snippets/highlight-sweep
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Launch twice as fast with less code.
```
### CSS
```css
.hl-sweep {
max-width: 12em;
margin: 0;
color: #1f2937;
font: 700 26px/1.4 system-ui, sans-serif;
}
.hl-sweep mark {
padding: 0 0.15em;
color: inherit;
background: linear-gradient(100deg, #fde047, #facc15) no-repeat 0 0 / 0% 100%;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
animation: hl-sweep-in 0.9s 0.3s cubic-bezier(0.6, 0, 0.3, 1) forwards;
}
@keyframes hl-sweep-in {
to { background-size: 100% 100%; }
}
@media (prefers-reduced-motion: reduce) {
.hl-sweep mark {
animation: none;
background-size: 100% 100%;
}
}
```
### Notes
- This CSS Highlight Sweep is 26 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Hand-Drawn Highlight
> An uneven, slightly tilted marker stroke behind a phrase that looks like it was drawn by hand.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: marker, sketch, emphasis, handmade, border-radius
- Live preview: https://copy-css.com/snippets/sketch-highlight
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
We build real products for real people.
```
### CSS
```css
.sketch-text {
max-width: 12em;
margin: 0;
color: #1c1917;
font: 700 26px/1.45 system-ui, sans-serif;
}
.sketch-mark {
position: relative;
z-index: 0;
white-space: nowrap;
}
.sketch-mark::before {
content: "";
position: absolute;
z-index: -1;
inset: 0.2em -0.3em 0 -0.25em;
border-radius: 0.8em 0.3em 0.9em 0.25em / 0.5em 0.9em 0.35em 0.8em;
background: #86efac;
transform: rotate(-2deg) skewX(-12deg);
}
```
### Notes
- This CSS Hand-Drawn Highlight is 22 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses transforms.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Hand-Drawn Circle
> A loose, double-stroked pen circle around a word, like a note scribbled on paper.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: annotation, emphasis, sketch, pen, border-radius
- Live preview: https://copy-css.com/snippets/hand-drawn-circle
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Plans start at $9 a month.
```
### CSS
```css
.circle-note {
max-width: 11em;
margin: 0;
color: #111827;
font: 700 26px/1.7 system-ui, sans-serif;
}
.circle-mark {
position: relative;
display: inline-block;
padding: 0 0.3em;
}
.circle-mark::before,
.circle-mark::after {
content: "";
position: absolute;
inset: -0.2em -0.15em -0.1em;
border: 2.5px solid #ef4444;
border-radius: 55% 45% 52% 48% / 60% 45% 55% 40%;
transform: rotate(-4deg);
pointer-events: none;
}
.circle-mark::after {
inset: -0.1em -0.3em -0.15em -0.2em;
border-width: 1.5px;
border-radius: 48% 52% 45% 55% / 45% 60% 40% 55%;
transform: rotate(3deg);
}
```
### Notes
- This CSS Hand-Drawn Circle is 30 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transforms.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Animated Strikethrough
> A marker line that slashes through old text, handy for sale prices and before-and-after copy.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: line-through, price, crossed out, sale, del
- Live preview: https://copy-css.com/snippets/animated-strikethrough
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Was $49 now $29
```
### CSS
```css
.strike-note {
margin: 0;
color: #111827;
font: 800 34px/1.3 system-ui, sans-serif;
}
.strike-line {
position: relative;
color: #6b7280;
text-decoration: none;
}
.strike-line::after {
content: "";
position: absolute;
top: 48%;
left: -0.1em;
right: -0.1em;
height: 0.12em;
border-radius: 1em;
background: #e11d48;
transform: rotate(-8deg) scaleX(0);
transform-origin: left;
animation: strike-line-draw 0.5s 0.4s ease-out forwards;
}
@keyframes strike-line-draw {
to { transform: rotate(-8deg) scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
.strike-line::after {
animation: none;
transform: rotate(-8deg);
}
}
```
### Notes
- This CSS Animated Strikethrough is 36 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Search Term Highlight
> Rounded, readable styling for the mark element in search results, with a forced-colors fallback.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: mark, search results, box-decoration-break, forced colors, accessibility
- Live preview: https://copy-css.com/snippets/search-term-highlight
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Free CSS snippets for buttons, loaders and CSS grid layouts.
```
### CSS
```css
.search-snippet {
max-width: 17em;
margin: 0;
color: #374151;
font: 400 18px/1.6 system-ui, sans-serif;
}
.search-mark {
padding: 0.05em 0.25em;
border-radius: 0.3em;
background: #fef08a;
color: #713f12;
font-weight: 600;
box-shadow: inset 0 -0.12em 0 #facc15;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
}
@media (forced-colors: active) {
.search-mark {
background: Mark;
color: MarkText;
}
}
```
### Notes
- This CSS Search Term Highlight is 24 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Striped Shadow Text
> Bold text with an offset shadow made of diagonal stripes, a retro screen-print effect.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: stripes, hatched, retro, offset, poster
- Live preview: https://copy-css.com/snippets/striped-shadow-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Poster
```
### CSS
```css
/* data-text must match the heading text */
.text-hatch {
position: relative;
isolation: isolate;
margin: 0;
color: #f43f5e;
font: 900 54px/1 system-ui, sans-serif;
}
.text-hatch::after {
content: attr(data-text);
content: attr(data-text) / "";
position: absolute;
top: 0.09em;
left: 0.09em;
z-index: -1;
background: repeating-linear-gradient(45deg, #1e293b 0 2px, #1e293b00 2px 6px);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
```
### Notes
- This CSS Striped Shadow Text is 21 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses linear gradients and gradient-clipped text.
- gradient-clipped text: Includes the -webkit- prefix Safari still needs.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Fire Text
> Burning text with stacked yellow, orange and red text-shadows that flicker like real flames.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: flame, burning, text-shadow, glow, flicker
- Live preview: https://copy-css.com/snippets/fire-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Blaze
```
### CSS
```css
.text-fire {
margin: 0;
padding-top: 0.3em;
color: #fffbeb;
font: 900 56px/1 system-ui, sans-serif;
text-shadow:
0 0 2px #fde047,
0 -3px 3px #fde047,
1px -7px 6px #fb923c,
-1px -12px 10px #f97316,
0 -20px 18px #dc2626,
0 0 30px #7c2d12;
animation: text-fire-flicker 1.2s ease-in-out infinite alternate;
}
@keyframes text-fire-flicker {
50% {
text-shadow:
0 0 3px #fde047,
1px -4px 4px #fde047,
-2px -9px 7px #fb923c,
2px -15px 12px #f97316,
-1px -24px 20px #dc2626,
0 0 34px #7c2d12;
}
}
@media (prefers-reduced-motion: reduce) {
.text-fire { animation: none; }
}
```
### Notes
- This CSS Fire Text is 30 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, text shadows and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Layered Color Shadow
> Bold text with four stacked colored shadows that fold back into the letters on hover.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: text-shadow, stacked, rainbow, offset, hover
- Live preview: https://copy-css.com/snippets/layered-shadow-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Layers
```
### CSS
```css
.text-layers {
margin: 0;
color: #1e1b4b;
font: 900 52px/1 system-ui, sans-serif;
text-shadow:
3px 3px 0 #f472b6,
6px 6px 0 #a78bfa,
9px 9px 0 #60a5fa,
12px 12px 0 #34d399;
transition: text-shadow 0.3s ease;
}
.text-layers:hover {
text-shadow:
0 0 0 #f472b6,
0 0 0 #a78bfa,
0 0 0 #60a5fa,
0 0 0 #34d399;
}
```
### Notes
- This CSS Layered Color Shadow is 19 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses transitions and text shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Chrome Text
> Shiny metallic chrome lettering with a mirrored horizon gradient and a soft drop shadow.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: metallic, silver, 80s, drop-shadow, shiny
- Live preview: https://copy-css.com/snippets/chrome-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
METAL
```
### CSS
```css
.text-chrome {
margin: 0;
font: 900 54px/1 system-ui, sans-serif;
letter-spacing: 0.04em;
background: linear-gradient(
180deg,
#ffffff 0%,
#cbd5e1 42%,
#334155 50%,
#94a3b8 60%,
#f8fafc 100%
);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
filter: drop-shadow(0 2px 0 #0f172a) drop-shadow(0 6px 10px #00000080);
}
```
### Notes
- This CSS Chrome Text is 17 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses linear gradients, filters and gradient-clipped text.
- gradient-clipped text: Includes the -webkit- prefix Safari still needs.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Staggered Letter Reveal
> Each letter of a headline rises into place one after another, staggered with a custom property.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: letters, stagger, entrance, hero, custom properties
- Live preview: https://copy-css.com/snippets/letter-stagger-reveal
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
WelcomeWelcome
```
### CSS
```css
.text-stagger {
margin: 0;
color: #312e81;
font: 800 46px/1.1 system-ui, sans-serif;
}
/* Full word for screen readers, letters are hidden from them */
.text-stagger-sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.text-stagger span span {
display: inline-block;
animation: text-stagger-in 0.6s calc(var(--i) * 70ms) cubic-bezier(0.2, 0.8, 0.2, 1.2) both;
}
@keyframes text-stagger-in {
from {
opacity: 0;
transform: translateY(0.5em) rotate(8deg);
}
}
@media (prefers-reduced-motion: reduce) {
.text-stagger span span { animation: none; }
}
```
### Notes
- This CSS Staggered Letter Reveal is 31 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, clip paths and custom properties.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Blur In Text
> Words that fade in from a soft blur one by one, a calm entrance for hero headlines.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: fade in, words, entrance, filter, stagger
- Live preview: https://copy-css.com/snippets/blur-in-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Calm,clearand focused
```
### CSS
```css
.text-blur {
max-width: 9em;
margin: 0;
color: #0f172a;
font: 700 34px/1.2 system-ui, sans-serif;
}
.text-blur span {
display: inline-block;
animation: text-blur-in 0.9s calc(var(--i) * 0.2s) ease-out both;
}
@keyframes text-blur-in {
from {
opacity: 0;
filter: blur(12px);
}
}
@media (prefers-reduced-motion: reduce) {
.text-blur span { animation: none; }
}
```
### Notes
- This CSS Blur In Text is 22 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses keyframe animations, filters, custom properties and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Block Reveal Text
> A solid color block wipes across the headline, then pulls away to reveal the text underneath.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: wipe, clip-path, entrance, editorial, headline
- Live preview: https://copy-css.com/snippets/block-reveal-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
New collection
```
### CSS
```css
.text-wipe {
position: relative;
display: inline-block;
margin: 0;
color: #881337;
font: 800 34px/1.15 system-ui, sans-serif;
animation: text-wipe-text 1.2s steps(1, start) both;
}
.text-wipe::after {
content: "";
position: absolute;
inset: 0;
background: #f43f5e;
animation: text-wipe-block 1.2s cubic-bezier(0.7, 0, 0.3, 1) both;
}
@keyframes text-wipe-block {
0% { clip-path: inset(0 100% 0 0); }
50% { clip-path: inset(0); }
100% { clip-path: inset(0 0 0 100%); }
}
@keyframes text-wipe-text {
0%, 50% { color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
.text-wipe,
.text-wipe::after { animation: none; }
.text-wipe::after { display: none; }
}
```
### Notes
- This CSS Block Reveal Text is 33 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, clip paths and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Spoiler Text
> Blurred spoiler text that comes into focus on hover, tap or keyboard focus, like on forums and chats.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: blur, hidden, reveal, censor, forum
- Live preview: https://copy-css.com/snippets/spoiler-text
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
The killer was the butler.
```
### CSS
```css
.spoiler-note {
max-width: 14em;
margin: 0;
color: #0f172a;
font: 500 22px/1.5 system-ui, sans-serif;
}
.spoiler-blur {
padding: 0 0.2em;
border-radius: 0.3em;
background: #e2e8f0;
color: transparent;
text-shadow: 0 0 0.35em #0f172a;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
cursor: pointer;
transition: color 0.25s ease, text-shadow 0.25s ease;
}
.spoiler-blur:hover,
.spoiler-blur:focus {
color: inherit;
text-shadow: none;
}
.spoiler-blur:focus-visible {
outline: 2px solid #2563eb;
outline-offset: 2px;
}
```
### Notes
- This CSS Spoiler Text is 29 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, text shadows and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Fluid Typography
> Headings and body text that scale smoothly with their container using clamp(), with no breakpoints.
- Category: [CSS Text Effects](https://copy-css.com/category/text)
- Tags: clamp, responsive, font-size, container units, scale
- Live preview: https://copy-css.com/snippets/fluid-typography
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Fluid type
Sizes scale smoothly with the container, between a set minimum and maximum.
```
### CSS
```css
/* cqi follows the container width. Swap it for vw to follow the viewport. */
.fluid-type {
container-type: inline-size;
color: #0f172a;
font-family: system-ui, sans-serif;
}
.fluid-type h2 {
margin: 0 0 0.4em;
font-size: clamp(1.5rem, 0.9rem + 6cqi, 3rem);
line-height: 1.1;
}
.fluid-type p {
margin: 0;
color: #475569;
font-size: clamp(0.875rem, 0.8rem + 1cqi, 1.125rem);
line-height: 1.5;
}
```
### Notes
- This CSS Fluid Typography is 19 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses container queries.
- container queries: Chrome 105+, Safari 16+, Firefox 110+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
# CSS Cards
Glassmorphism, hover lift, glowing borders and 3D flip cards.
## Glassmorphism Card
> A frosted glass card using backdrop-filter blur over a colorful background.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: glass, glassmorphism, blur, frosted, backdrop-filter
- Live preview: https://copy-css.com/snippets/glass-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Glassmorphism
Frosted glass with backdrop-filter.
```
### CSS
```css
.glass-card {
width: 220px;
padding: 24px;
border: 1px solid rgba(255, 255, 255, 0.35);
border-radius: 20px;
background: rgba(255, 255, 255, 0.15);
-webkit-backdrop-filter: blur(14px);
backdrop-filter: blur(14px);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
color: #fff;
font-family: system-ui, sans-serif;
}
.glass-card h3 {
margin: 0 0 6px;
font-size: 18px;
}
.glass-card p {
margin: 0;
font-size: 14px;
line-height: 1.5;
opacity: 0.85;
}
```
### Notes
- This CSS Glassmorphism Card is 24 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses box shadows and backdrop filters.
- backdrop filters: Includes the -webkit- prefix for older Safari.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Hover Lift Card
> A clean, minimal card that lifts up with a soft shadow on hover.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: hover, lift, shadow, clean
- Live preview: https://copy-css.com/snippets/hover-lift-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
New
Hover me
A clean card that lifts with a soft shadow.
```
### CSS
```css
.card-lift {
width: 220px;
padding: 22px;
border: 1px solid #e5e7eb;
border-radius: 16px;
background: #fff;
font-family: system-ui, sans-serif;
transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-lift:hover {
transform: translateY(-6px);
box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.18);
}
.card-lift-tag {
display: inline-block;
padding: 3px 10px;
border-radius: 999px;
background: #eef2ff;
color: #4f46e5;
font-size: 12px;
font-weight: 700;
}
.card-lift h3 {
margin: 12px 0 4px;
font-size: 18px;
}
.card-lift p {
margin: 0;
color: #6b7280;
font-size: 14px;
line-height: 1.5;
}
```
### Notes
- This CSS Hover Lift Card is 36 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, transforms and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Glowing Border Card
> A dark card with a gradient border and a colorful ambient glow.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: gradient, border, glow, dark
- Live preview: https://copy-css.com/snippets/glow-border-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Pro plan
Everything you need to ship faster.
```
### CSS
```css
.card-glow {
width: 220px;
padding: 24px;
border: 2px solid transparent;
border-radius: 16px;
background:
linear-gradient(#0f172a, #0f172a) padding-box,
linear-gradient(135deg, #22d3ee, #a855f7, #f43f5e) border-box;
box-shadow:
-12px -12px 40px -16px #22d3ee,
12px 12px 40px -16px #f43f5e;
color: #e2e8f0;
font-family: system-ui, sans-serif;
}
.card-glow h3 {
margin: 0 0 6px;
font-size: 18px;
}
.card-glow p {
margin: 0;
color: #94a3b8;
font-size: 14px;
line-height: 1.5;
}
```
### Notes
- This CSS Glowing Border Card is 26 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses linear gradients and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## 3D Flip Card
> A card that flips over in 3D on hover to reveal its back side.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: flip, 3d, rotate, hover, perspective
- Live preview: https://copy-css.com/snippets/flip-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Hover to flip
Surprise!
```
### CSS
```css
.flip-card {
width: 190px;
height: 120px;
perspective: 800px;
font: 700 18px/1 system-ui, sans-serif;
}
.flip-inner {
position: relative;
width: 100%;
height: 100%;
transform-style: preserve-3d;
transition: transform 0.6s ease;
}
.flip-card:hover .flip-inner {
transform: rotateY(180deg);
}
.flip-front,
.flip-back {
position: absolute;
inset: 0;
display: grid;
place-items: center;
border-radius: 14px;
color: #fff;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.flip-front { background: #7c3aed; }
.flip-back {
background: #db2777;
transform: rotateY(180deg);
}
```
### Notes
- This CSS 3D Flip Card is 37 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, 3D transforms, transforms and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Profile Card
> A compact user card with a gradient avatar and a follow button.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: profile, user, avatar, follow, social
- Live preview: https://copy-css.com/snippets/profile-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
JD
Jamie Doe
Designer
```
### CSS
```css
.profile {
display: flex;
align-items: center;
gap: 12px;
width: 260px;
padding: 14px;
border-radius: 16px;
background: #fff;
box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.2);
font-family: system-ui, sans-serif;
}
.profile-avatar {
display: grid;
flex: none;
place-items: center;
width: 46px;
height: 46px;
border-radius: 50%;
background: linear-gradient(135deg, #f59e0b, #ec4899);
color: #fff;
font-weight: 700;
}
.profile h3 {
margin: 0;
color: #111;
font-size: 15px;
}
.profile p {
margin: 2px 0 0;
color: #6b7280;
font-size: 13px;
}
.profile button {
margin-left: auto;
padding: 8px 14px;
border: 0;
border-radius: 999px;
background: #111;
color: #fff;
font: 600 13px system-ui, sans-serif;
cursor: pointer;
}
```
### Notes
- This CSS Profile Card is 46 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses linear gradients, box shadows, CSS Grid and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Hover Reveal Card
> An image card whose caption slides up with extra details on hover.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: image, overlay, caption, hover, reveal
- Live preview: https://copy-css.com/snippets/hover-reveal-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Mountains
Hover to read more
```
### CSS
```css
.reveal-card {
position: relative;
overflow: hidden;
width: 220px;
height: 150px;
border-radius: 16px;
/* Swap for: url(photo.jpg) center / cover */
background: linear-gradient(160deg, #38bdf8, #6366f1 60%, #1e1b4b);
color: #fff;
font-family: system-ui, sans-serif;
}
.reveal-caption {
position: absolute;
right: 0;
bottom: 0;
left: 0;
padding: 14px 16px;
background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
transform: translateY(40%);
transition: transform 0.3s ease;
}
.reveal-card h3 {
margin: 0;
font-size: 17px;
}
.reveal-card p {
margin: 4px 0 0;
font-size: 13px;
opacity: 0;
transition: opacity 0.3s ease;
}
.reveal-card:hover .reveal-caption {
transform: none;
}
.reveal-card:hover p {
opacity: 0.85;
}
```
### Notes
- This CSS Hover Reveal Card is 42 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, transforms and linear gradients.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Stat Card
> A clean dashboard metric card with a big number and a trend badge.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: dashboard, kpi, metric, analytics, number
- Live preview: https://copy-css.com/snippets/stat-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Monthly visitors
48,210▲ 12.4%
```
### CSS
```css
.stat-card {
width: 200px;
padding: 18px 20px;
border: 1px solid #e5e7eb;
border-radius: 16px;
background: #fff;
font-family: system-ui, sans-serif;
}
.stat-card p {
margin: 0;
color: #6b7280;
font-size: 13px;
font-weight: 500;
}
.stat-card strong {
display: block;
margin: 6px 0 10px;
color: #111;
font-size: 30px;
font-variant-numeric: tabular-nums;
letter-spacing: -0.02em;
}
.stat-up {
display: inline-block;
padding: 3px 8px;
border-radius: 999px;
background: #dcfce7;
color: #15803d;
font-size: 12px;
font-weight: 700;
}
```
### Notes
- This CSS Stat Card is 34 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Notification Card
> A success notification with an accent border, icon and dismiss button.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: notification, toast, alert, success, message
- Live preview: https://copy-css.com/snippets/notification-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
✓
Changes saved
Your profile has been updated.
```
### CSS
```css
.notice {
display: flex;
align-items: flex-start;
gap: 12px;
width: 260px;
padding: 14px;
border-left: 4px solid #22c55e;
border-radius: 12px;
background: #fff;
box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.2);
font-family: system-ui, sans-serif;
}
.notice-icon {
display: grid;
flex: none;
place-items: center;
width: 24px;
height: 24px;
border-radius: 50%;
background: #dcfce7;
color: #16a34a;
font-size: 13px;
font-weight: 800;
}
.notice strong {
display: block;
color: #111;
font-size: 14px;
}
.notice p {
margin: 2px 0 0;
color: #6b7280;
font-size: 13px;
line-height: 1.4;
}
.notice-close {
margin-left: auto;
padding: 0 4px;
border: 0;
background: none;
color: #9ca3af;
font-size: 20px;
line-height: 1;
cursor: pointer;
}
.notice-close:hover {
color: #111;
}
```
### Notes
- This CSS Notification Card is 53 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses box shadows, CSS Grid and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Ticket Card
> An event ticket with punched-out side notches made from radial gradients.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: ticket, coupon, notch, radial-gradient, event
- Live preview: https://copy-css.com/snippets/ticket-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Admit one
Design SummitRow 4 · Seat 12
```
### CSS
```css
.ticket {
display: grid;
gap: 2px;
width: 220px;
padding: 18px 26px;
border-radius: 12px;
background:
radial-gradient(circle at 0 50%, transparent 11px, #7c3aed 12px) left / 51% 100% no-repeat,
radial-gradient(circle at 100% 50%, transparent 11px, #7c3aed 12px) right / 51% 100% no-repeat;
color: #fff;
font-family: system-ui, sans-serif;
filter: drop-shadow(0 8px 14px rgba(124, 58, 237, 0.35));
}
.ticket small {
font-size: 11px;
font-weight: 700;
letter-spacing: 0.14em;
text-transform: uppercase;
opacity: 0.75;
}
.ticket strong {
font-size: 20px;
}
.ticket span {
font-size: 13px;
opacity: 0.85;
}
```
### Notes
- This CSS Ticket Card is 30 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses radial gradients, filters and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Pricing Card
> A clean pricing plan card with a price, a feature list and a full-width button.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: pricing, plan, saas, features, cta
- Live preview: https://copy-css.com/snippets/pricing-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.overlay-card {
position: relative;
display: block;
overflow: hidden;
width: 220px;
height: 160px;
border-radius: 16px;
color: #fff;
text-decoration: none;
font-family: system-ui, sans-serif;
}
/* Swap the background for your own image */
.overlay-media {
position: absolute;
inset: 0;
background: #94a3b8 center / cover;
transition: transform 0.4s ease;
}
.overlay-card::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 60%);
}
.overlay-card:hover .overlay-media {
transform: scale(1.06);
}
.overlay-text {
position: absolute;
z-index: 1;
left: 16px;
right: 16px;
bottom: 14px;
display: grid;
gap: 2px;
}
.overlay-text small {
opacity: 0.8;
font-size: 11px;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.overlay-text strong {
font-size: 16px;
}
```
### Notes
- This CSS Caption Overlay Card is 51 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, transforms, linear gradients and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Blog Post Card
> A compact article card with a thumbnail, tag and meta line, where the whole card is one link.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: blog, article, post, thumbnail, horizontal, link
- Live preview: https://copy-css.com/snippets/blog-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.expand-cards {
display: flex;
gap: 8px;
width: 100%;
height: 300px;
}
/* Set each panel's background-image inline */
.expand-cards > * {
flex: 1;
display: flex;
align-items: flex-end;
min-width: 0;
padding: 12px;
overflow: hidden;
border-radius: 14px;
background: #d4d4d8 center / cover;
color: #fff;
font: 700 14px system-ui, sans-serif;
text-decoration: none;
white-space: nowrap;
transition: flex-grow 0.45s ease;
}
.expand-cards span {
opacity: 0;
text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
transition: opacity 0.3s ease;
}
/* The hovered or focused panel grows. The first one is open by default. */
.expand-cards > :hover,
.expand-cards > :focus-visible,
.expand-cards:not(:hover, :focus-within) > :first-child {
flex-grow: 4;
}
.expand-cards > :hover span,
.expand-cards > :focus-visible span,
.expand-cards:not(:hover, :focus-within) > :first-child span {
opacity: 1;
}
.expand-cards > :focus-visible {
outline: 2px solid #4338ca;
outline-offset: 2px;
}
```
### Notes
- This CSS Expanding Cards is 47 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses transitions, text shadows, Flexbox and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Animated Border Card
> A dark card with a gradient border that keeps rotating around its edge.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: border, animated, conic, rotate, gradient, dark
- Live preview: https://copy-css.com/snippets/animated-border-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Realtime sync
Every change shows up everywhere, instantly.
```
### CSS
```css
.border-spin {
position: relative;
isolation: isolate;
overflow: hidden;
width: 220px;
padding: 22px;
border-radius: 16px;
color: #cbd5e1;
font: 14px/1.5 system-ui, sans-serif;
}
/* A spinning gradient, larger than the card */
.border-spin::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
z-index: -2;
width: 200%;
aspect-ratio: 1;
background: conic-gradient(#22d3ee, #a855f7, #f43f5e, #22d3ee);
translate: -50% -50%;
animation: border-spin 4s linear infinite;
}
/* The inner panel covers all but a 2px edge */
.border-spin::after {
content: "";
position: absolute;
inset: 2px;
z-index: -1;
border-radius: 14px;
background: #0f172a;
}
.border-spin h3 {
margin: 0 0 6px;
color: #f8fafc;
font-size: 17px;
}
.border-spin p {
margin: 0;
}
@keyframes border-spin {
to { rotate: 1turn; }
}
@media (prefers-reduced-motion: reduce) {
.border-spin::before { animation: none; }
}
```
### Notes
- This CSS Animated Border Card is 52 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses keyframe animations, conic gradients, aspect-ratio and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Fan-out Card Stack
> A neat stack of cards that fans out like a hand of cards when you hover it.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: stack, deck, fan, hover, photos, rotate
- Live preview: https://copy-css.com/snippets/fan-out-cards
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.fan {
position: relative;
width: 120px;
height: 150px;
}
/* Set each card's background-image to a photo */
.fan > * {
position: absolute;
inset: 0;
border: 4px solid #fff;
border-radius: 14px;
background: #e7e5e4 center / cover;
box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.45);
transform-origin: 50% 100%;
transition: transform 0.45s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.fan > :nth-child(1) { transform: rotate(-4deg); }
.fan > :nth-child(3) { transform: rotate(4deg); }
.fan:hover > :nth-child(1),
.fan:focus-visible > :nth-child(1) {
transform: translateX(-18px) rotate(-12deg);
}
.fan:hover > :nth-child(2),
.fan:focus-visible > :nth-child(2) {
transform: translateY(-8px);
}
.fan:hover > :nth-child(3),
.fan:focus-visible > :nth-child(3) {
transform: translateX(18px) rotate(12deg);
}
.fan:focus-visible {
outline: none;
}
```
### Notes
- This CSS Fan-out Card Stack is 39 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Payment Card
> A bank-card style design at the real 1.586 card ratio, with a chip, masked number and soft sheen.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: credit card, debit, wallet, checkout, gradient, fintech
- Live preview: https://copy-css.com/snippets/payment-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
•••• •••• •••• 4242
Alex Morgan09/29
```
### CSS
```css
.pay-card {
box-sizing: border-box;
display: grid;
align-content: space-between;
width: 240px;
aspect-ratio: 1.586;
padding: 18px;
border-radius: 14px;
background:
radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.28), transparent 55%),
linear-gradient(135deg, #1e3a8a, #7c3aed);
color: #fff;
font-family: system-ui, sans-serif;
box-shadow: 0 18px 36px -16px rgba(30, 58, 138, 0.7);
}
.pay-chip {
width: 36px;
height: 26px;
border-radius: 6px;
background: linear-gradient(135deg, #fde68a, #d97706);
box-shadow: inset 0 0 0 1px rgba(120, 53, 15, 0.3);
}
.pay-number {
font: 600 15px ui-monospace, "SF Mono", Menlo, monospace;
letter-spacing: 0.06em;
white-space: nowrap;
}
.pay-meta {
display: flex;
justify-content: space-between;
font-size: 11px;
letter-spacing: 0.08em;
text-transform: uppercase;
opacity: 0.85;
}
```
### Notes
- This CSS Payment Card is 38 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses linear gradients, radial gradients, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Event Card
> A compact event row with a tear-off calendar date badge, ready for agendas and listings.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: event, calendar, date, meetup, schedule, list
- Live preview: https://copy-css.com/snippets/event-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Design Systems Meetup
6:30 PM · Berlin
```
### CSS
```css
.event-card {
display: flex;
align-items: center;
gap: 14px;
max-width: 320px;
padding: 12px 18px 12px 12px;
border: 1px solid #e4e4e7;
border-radius: 16px;
background: #fff;
font-family: system-ui, sans-serif;
}
.event-date {
flex: none;
display: flex;
flex-direction: column;
width: 56px;
overflow: hidden;
border-radius: 12px;
background: #fff;
box-shadow: 0 0 0 1px #e4e4e7, 0 4px 10px -6px rgba(0, 0, 0, 0.3);
line-height: 1;
text-align: center;
}
.event-date span {
padding: 5px 0;
background: #ef4444;
color: #fff;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.event-date strong {
padding: 7px 0 9px;
color: #18181b;
font-size: 22px;
}
.event-card h3 {
margin: 0 0 4px;
color: #18181b;
font-size: 15px;
line-height: 1.3;
}
.event-card p {
margin: 0;
color: #71717a;
font-size: 13px;
}
```
### Notes
- This CSS Event Card is 53 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses box shadows and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Profile Cover Card
> A user profile card with a gradient cover banner, an overlapping avatar and a row of follower stats.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: profile, cover, banner, avatar, followers, social
- Live preview: https://copy-css.com/snippets/profile-cover-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
MR
Maya Reyes
Product designer · Lisbon
Posts
128
Followers
4.2k
Following
310
```
### CSS
```css
.pcover {
width: 240px;
overflow: hidden;
border-radius: 18px;
background: #fff;
box-shadow: 0 12px 32px -12px rgba(30, 27, 75, 0.25);
color: #1e1b4b;
font-family: system-ui, sans-serif;
text-align: center;
}
.pcover-banner {
height: 52px;
background: linear-gradient(120deg, #818cf8, #c084fc, #f472b6);
}
.pcover-avatar {
display: grid;
place-items: center;
width: 56px;
height: 56px;
margin: -28px auto 0;
border: 4px solid #fff;
border-radius: 50%;
background: #312e81;
color: #fff;
font-size: 18px;
font-weight: 700;
}
.pcover h3 {
margin: 6px 0 2px;
font-size: 16px;
}
.pcover p {
margin: 0;
color: #6b7280;
font-size: 13px;
}
.pcover-stats {
display: grid;
grid-template-columns: repeat(3, 1fr);
margin: 12px 0 0;
padding: 10px 0 12px;
border-top: 1px solid #eef2ff;
}
.pcover-stats div {
display: flex;
flex-direction: column-reverse;
}
.pcover-stats dd {
margin: 0;
font-size: 15px;
font-weight: 700;
}
.pcover-stats dt {
color: #6b7280;
font-size: 11px;
}
```
### Notes
- This CSS Profile Cover Card is 64 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses linear gradients, box shadows, CSS Grid and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Team Member Card
> A centered team member card for about pages, with a ringed portrait, role and round contact links.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: team, about page, staff, social links, avatar, portrait
- Live preview: https://copy-css.com/snippets/team-member-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
LK
Leo Kim
Head of Engineering
```
### CSS
```css
.team-card {
--accent: #0d9488;
width: 200px;
padding: 20px 16px;
border: 1px solid #ccfbf1;
border-radius: 16px;
background: #fff;
color: #134e4a;
font-family: system-ui, sans-serif;
text-align: center;
}
.team-card-photo {
display: grid;
place-items: center;
width: 64px;
height: 64px;
margin: 0 auto 10px;
border-radius: 50%;
background: linear-gradient(135deg, #5eead4, #0f766e);
box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent);
color: #fff;
font-size: 20px;
font-weight: 700;
}
.team-card h3 {
margin: 0;
font-size: 16px;
}
.team-card p {
margin: 2px 0 12px;
color: #5f7f7c;
font-size: 13px;
}
.team-card-links {
display: flex;
justify-content: center;
gap: 8px;
margin: 0;
padding: 0;
list-style: none;
}
.team-card-links a {
display: grid;
place-items: center;
width: 34px;
height: 34px;
border-radius: 50%;
background: #f0fdfa;
color: var(--accent);
transition: background 0.2s ease, color 0.2s ease;
}
.team-card-links a:hover {
background: var(--accent);
color: #fff;
}
.team-card-links a:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
.team-card-links svg {
width: 16px;
height: 16px;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
}
```
### Notes
- This CSS Team Member Card is 76 lines of pure CSS (1.3 KB) with no JavaScript and no dependencies. It uses transitions, linear gradients, box shadows and CSS Grid.
- Customize with: `--accent`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Contact Card
> A contact card with an avatar, role and clickable email and phone links marked with small icons.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: contact, vcard, email, phone, business card, support
- Live preview: https://copy-css.com/snippets/contact-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
AO
```
### CSS
```css
.more-card {
width: 230px;
padding: 18px 20px;
border-radius: 16px;
background: #fff;
box-shadow: 0 4px 16px -6px rgba(76, 29, 149, 0.25);
color: #2e1065;
font-family: system-ui, sans-serif;
}
.more-card h3 {
margin: 0;
font-size: 17px;
}
.more-card p {
margin: 4px 0 0;
color: #6d5c91;
font-size: 14px;
line-height: 1.5;
}
.more-card-extra {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 0.35s ease;
}
.more-card-extra > div {
overflow: hidden;
}
.more-card:hover .more-card-extra,
.more-card:focus-within .more-card-extra {
grid-template-rows: 1fr;
}
.more-card-extra p {
margin-top: 10px;
padding-top: 10px;
border-top: 1px solid #ede9fe;
}
.more-card a {
display: inline-block;
margin: 8px 0 2px;
color: #7c3aed;
font-size: 14px;
font-weight: 700;
}
.more-card a:focus-visible {
outline: 2px solid #7c3aed;
outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
.more-card-extra {
transition: none;
}
}
```
### Notes
- This CSS Expanding Details Card is 61 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses transitions, box shadows, CSS Grid and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Corner Fill Card
> A link card where a small corner circle grows to flood the card with color and invert the text on hover.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: hover, fill, circle, scale, link card, color change
- Live preview: https://copy-css.com/snippets/corner-fill-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
→
```
### CSS
```css
.shine-card {
position: relative;
display: block;
width: 230px;
padding: 22px;
overflow: hidden;
border-radius: 18px;
background: linear-gradient(135deg, #1f2937, #0b0f19);
box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.6);
color: #f8fafc;
font-family: system-ui, sans-serif;
text-decoration: none;
}
.shine-card::after {
content: "";
position: absolute;
top: 0;
left: -75%;
width: 50%;
height: 100%;
background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
transform: skewX(-20deg);
transition: left 0.7s ease;
pointer-events: none;
}
.shine-card:hover::after,
.shine-card:focus-visible::after {
left: 130%;
}
.shine-card:focus-visible {
outline: 3px solid #fbbf24;
outline-offset: 3px;
}
.shine-card small {
color: #fbbf24;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
}
.shine-card h3 {
margin: 6px 0;
background: linear-gradient(90deg, #fde68a, #f59e0b);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
font-size: 24px;
}
.shine-card p {
margin: 0;
color: #94a3b8;
font-size: 13px;
line-height: 1.5;
}
@media (prefers-reduced-motion: reduce) {
.shine-card::after {
display: none;
}
}
```
### Notes
- This CSS Shine Hover Card is 66 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses transitions, transforms, linear gradients and box shadows.
- gradient-clipped text: Includes the -webkit- prefix Safari still needs.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Review Card
> A customer review card with a star rating, verified-buyer badge, short title, review text and date.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: review, rating, stars, verified, customer, social proof
- Live preview: https://copy-css.com/snippets/review-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
★★★★★
Verified buyer
Exactly what I needed
Setup took two minutes and it has run without a hiccup since. Support answered within the hour.
```
### CSS
```css
.review-card {
width: 260px;
padding: 16px 18px;
border: 1px solid #e2e8f0;
border-radius: 14px;
background: #fff;
color: #0f172a;
font-family: system-ui, sans-serif;
}
.review-card header {
display: flex;
justify-content: space-between;
align-items: center;
}
.review-card-stars {
margin: 0;
color: #f59e0b;
font-size: 16px;
letter-spacing: 2px;
}
.review-card-verified {
padding: 2px 8px;
border-radius: 999px;
background: #dcfce7;
color: #166534;
font-size: 11px;
font-weight: 600;
}
.review-card-verified::before {
content: "✓ ";
}
.review-card h3 {
margin: 10px 0 4px;
font-size: 15px;
}
.review-card > p {
margin: 0;
color: #475569;
font-size: 13px;
line-height: 1.5;
}
.review-card footer {
margin-top: 10px;
color: #94a3b8;
font-size: 12px;
}
.review-card footer strong {
color: #0f172a;
}
```
### Notes
- This CSS Review Card is 57 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Social Post Card
> A social media post embed with avatar, name, handle, post text, timestamp and like count for testimonial walls.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: tweet, social media, post, embed, testimonial, wall of love
- Live preview: https://copy-css.com/snippets/social-post-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
DV
Dana Vu@danavu
Shipped our new pricing page with zero JavaScript. CSS :has() is doing all the heavy lifting.
```
### CSS
```css
.post-embed {
width: 270px;
padding: 14px 16px;
border: 1px solid #e0f2fe;
border-radius: 16px;
background: #fff;
color: #0f172a;
font-family: system-ui, sans-serif;
}
.post-embed header {
display: flex;
align-items: center;
gap: 10px;
}
.post-embed-avatar {
display: grid;
place-items: center;
width: 38px;
height: 38px;
border-radius: 50%;
background: linear-gradient(135deg, #38bdf8, #0369a1);
color: #fff;
font-size: 13px;
font-weight: 700;
}
.post-embed header p {
display: grid;
margin: 0;
font-size: 14px;
line-height: 1.25;
}
.post-embed header p span {
color: #64748b;
font-size: 13px;
}
.post-embed > p {
margin: 10px 0;
font-size: 14px;
line-height: 1.5;
}
.post-embed footer {
display: flex;
justify-content: space-between;
padding-top: 8px;
border-top: 1px solid #f1f5f9;
color: #64748b;
font-size: 12px;
}
.post-embed footer span span {
color: #e11d48;
}
```
### Notes
- This CSS Social Post Card is 58 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses linear gradients, CSS Grid and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Centered Testimonial
> A centered testimonial with the avatar sitting on the top edge, a large quote and name with company below.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: testimonial, quote, avatar, centered, landing page, customer
- Live preview: https://copy-css.com/snippets/centered-testimonial-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
EM
We replaced three internal tools with this, and nobody misses them.
Elena MarshCOO, Brightpath
```
### CSS
```css
.tcenter {
width: 250px;
margin: 30px 0 0;
padding: 38px 20px 18px;
border-radius: 18px;
background: #fff;
box-shadow: 0 12px 30px -16px rgba(6, 78, 59, 0.4);
color: #064e3b;
font-family: system-ui, sans-serif;
text-align: center;
}
.tcenter-avatar {
display: grid;
place-items: center;
width: 56px;
height: 56px;
margin: -66px auto 12px;
border: 4px solid #ecfdf5;
border-radius: 50%;
background: #10b981;
color: #fff;
font-weight: 700;
}
.tcenter blockquote {
margin: 0;
font-size: 16px;
font-weight: 500;
line-height: 1.45;
}
.tcenter blockquote::before {
content: "“";
}
.tcenter blockquote::after {
content: "”";
}
.tcenter figcaption {
display: grid;
margin-top: 12px;
font-size: 13px;
}
.tcenter figcaption span {
color: #6b8f80;
}
```
### Notes
- This CSS Centered Testimonial is 49 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Sparkline Stat Card
> A dark dashboard metric card with a big number, change badge and an inline SVG sparkline with area fill.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: dashboard, kpi, sparkline, chart, svg, analytics, dark
- Live preview: https://copy-css.com/snippets/sparkline-stat-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Revenue
$84.2k+8.1%
```
### CSS
```css
.spark-stat {
--spark: #34d399;
display: grid;
grid-template-columns: 1fr auto;
align-items: center;
width: 220px;
padding: 16px 18px 0;
overflow: hidden;
border: 1px solid #1e293b;
border-radius: 16px;
background: #111827;
color: #f8fafc;
font-family: system-ui, sans-serif;
}
.spark-stat p {
grid-column: 1 / -1;
margin: 0;
color: #94a3b8;
font-size: 13px;
}
.spark-stat strong {
font-size: 28px;
letter-spacing: -0.02em;
}
.spark-stat-delta {
padding: 2px 8px;
border-radius: 999px;
background: rgba(52, 211, 153, 0.15);
color: var(--spark);
font-size: 12px;
font-weight: 700;
}
.spark-stat svg {
grid-column: 1 / -1;
width: calc(100% + 36px);
height: 48px;
margin: 8px -18px 0;
}
.spark-stat-area {
fill: var(--spark);
opacity: 0.15;
}
.spark-stat-line {
fill: none;
stroke: var(--spark);
stroke-width: 2;
stroke-linejoin: round;
vector-effect: non-scaling-stroke;
}
```
### Notes
- This CSS Sparkline Stat Card is 55 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses CSS Grid and custom properties.
- Customize with: `--spark`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Goal Progress Card
> A metric card with a conic-gradient progress ring, set by one custom property, next to the goal amount.
- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: progress ring, goal, conic-gradient, dashboard, kpi, percentage
- Live preview: https://copy-css.com/snippets/goal-progress-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
72%
Monthly goal
$7,200 / $10,00018 days left
```
### CSS
```css
.goal-card {
--ring: #db2777;
display: flex;
align-items: center;
gap: 16px;
width: 270px;
padding: 16px 18px;
border-radius: 18px;
background: #fff;
box-shadow: 0 8px 24px -12px rgba(131, 24, 67, 0.35);
color: #500724;
font-family: system-ui, sans-serif;
}
.goal-card-ring {
display: grid;
flex: none;
place-items: center;
width: 72px;
height: 72px;
border-radius: 50%;
background: conic-gradient(var(--ring) calc(var(--p) * 1%), #fce7f3 0);
}
.goal-card-ring span {
display: grid;
place-items: center;
width: 56px;
height: 56px;
border-radius: 50%;
background: #fff;
font-size: 15px;
font-weight: 800;
}
.goal-card p {
margin: 0;
color: #9d4b73;
font-size: 12px;
}
.goal-card strong {
display: block;
margin: 2px 0;
font-size: 20px;
}
.goal-card small {
color: #be8aa5;
font-size: 12px;
font-weight: 500;
}
.goal-card-ring + div > span {
color: var(--ring);
font-size: 12px;
font-weight: 600;
}
```
### Notes
- This CSS Goal Progress Card is 58 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses conic gradients, box shadows, CSS Grid and Flexbox.
- Customize with: `--ring`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
# CSS Form Elements
Floating labels, toggle switches, custom checkboxes, selects, ratings and more.
## Floating Label Input
> A text input whose label floats up when focused or filled. No JavaScript.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: input, label, form, material, focus
- Live preview: https://copy-css.com/snippets/floating-label-input
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.field-float {
position: relative;
display: block;
width: 240px;
font-family: system-ui, sans-serif;
}
.field-float input {
box-sizing: border-box;
width: 100%;
padding: 22px 14px 8px;
border: 1.5px solid #d1d5db;
border-radius: 10px;
background: #fff;
font-size: 16px;
outline: none;
transition: border-color 0.2s ease;
}
.field-float span {
position: absolute;
top: 50%;
left: 15px;
color: #6b7280;
font-size: 16px;
pointer-events: none;
transform: translateY(-50%);
transition: 0.2s ease;
}
.field-float input:focus {
border-color: #6366f1;
}
.field-float input:focus + span,
.field-float input:not(:placeholder-shown) + span {
top: 15px;
color: #6366f1;
font-size: 12px;
}
```
### Notes
- This CSS Floating Label Input is 40 lines of pure CSS (0.7 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.
## Toggle Switch
> An accessible mobile-style toggle switch built on a real checkbox.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: switch, toggle, checkbox, mobile
- Live preview: https://copy-css.com/snippets/toggle-switch
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.switch {
position: relative;
display: inline-block;
width: 52px;
height: 30px;
}
.switch input {
width: 0;
height: 0;
opacity: 0;
}
.switch .slider {
position: absolute;
inset: 0;
border-radius: 999px;
background: #d1d5db;
cursor: pointer;
transition: background 0.25s ease;
}
.switch .slider::before {
content: "";
position: absolute;
top: 3px;
left: 3px;
width: 24px;
height: 24px;
border-radius: 50%;
background: #fff;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
transition: transform 0.25s ease;
}
.switch input:checked + .slider {
background: #22c55e;
}
.switch input:checked + .slider::before {
transform: translateX(22px);
}
.switch input:focus-visible + .slider {
outline: 2px solid #22c55e;
outline-offset: 2px;
}
```
### Notes
- This CSS Toggle Switch is 47 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and the :checked state (no JavaScript).
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Custom Checkbox
> A styled checkbox with a crisp checkmark, using appearance: none.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: checkbox, check, form, appearance
- Live preview: https://copy-css.com/snippets/custom-checkbox
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.checkbox {
display: inline-flex;
align-items: center;
gap: 10px;
font: 16px system-ui, sans-serif;
cursor: pointer;
}
.checkbox input {
display: grid;
place-content: center;
width: 22px;
height: 22px;
margin: 0;
border: 2px solid #9ca3af;
border-radius: 6px;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
transition: background 0.2s ease, border-color 0.2s ease;
}
.checkbox input::before {
content: "";
width: 12px;
height: 12px;
background: #fff;
clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
transform: scale(0);
transition: transform 0.15s ease;
}
.checkbox input:checked {
border-color: #6366f1;
background: #6366f1;
}
.checkbox input:checked::before {
transform: scale(1);
}
```
### Notes
- This CSS Custom Checkbox is 40 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, transforms, clip paths and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Range Slider
> A custom range slider with a gradient track and a ring-style thumb.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: range, slider, input, gradient
- Live preview: https://copy-css.com/snippets/range-slider
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.range {
width: 220px;
height: 6px;
border-radius: 999px;
background: linear-gradient(90deg, #6366f1, #ec4899);
outline: none;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
}
.range::-webkit-slider-thumb {
width: 22px;
height: 22px;
border: 4px solid #6366f1;
border-radius: 50%;
background: #fff;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
-webkit-appearance: none;
appearance: none;
}
.range::-moz-range-thumb {
width: 14px;
height: 14px;
border: 4px solid #6366f1;
border-radius: 50%;
background: #fff;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
/* Keyboard focus: a ring around the thumb (kept as two rules, browsers drop mixed selector lists) */
.range:focus-visible::-webkit-slider-thumb {
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.35);
}
.range:focus-visible::-moz-range-thumb {
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.35);
}
```
### Notes
- This CSS Range Slider is 39 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses linear gradients, box shadows and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Search Input
> A rounded search field with a built-in icon and a soft focus ring.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: search, input, icon, focus ring, pill
- Live preview: https://copy-css.com/snippets/search-input
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.search-input {
box-sizing: border-box;
width: 220px;
padding: 12px 16px 12px 42px;
border: 1.5px solid #e5e7eb;
border-radius: 999px;
background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 15px center / 18px;
color: #111;
font: 15px system-ui, sans-serif;
outline: none;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input:focus {
border-color: #6366f1;
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
```
### Notes
- This CSS Search Input is 17 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Segmented Control
> A mobile-style segmented switch built on accessible radio buttons.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: segmented, radio, switch, toggle, tabs, billing
- Live preview: https://copy-css.com/snippets/segmented-control
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.segmented {
display: inline-flex;
padding: 4px;
border-radius: 12px;
background: #f1f5f9;
font: 600 14px system-ui, sans-serif;
}
.segmented input {
position: absolute;
opacity: 0;
pointer-events: none;
}
.segmented span {
display: block;
padding: 9px 18px;
border-radius: 9px;
color: #64748b;
cursor: pointer;
transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.segmented input:checked + span {
background: #fff;
color: #0f172a;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.segmented input:focus-visible + span {
outline: 2px solid #6366f1;
outline-offset: 2px;
}
```
### Notes
- This CSS Segmented Control is 33 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, box shadows, Flexbox and the :checked state (no JavaScript).
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Custom Select
> A native select restyled with a custom chevron. Still fully accessible.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: select, dropdown, chevron, appearance, form
- Live preview: https://copy-css.com/snippets/custom-select
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.select {
width: 220px;
padding: 12px 40px 12px 14px;
border: 1.5px solid #d1d5db;
border-radius: 10px;
background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
color: #111;
font: 15px system-ui, sans-serif;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
}
.select:focus {
border-color: #6366f1;
outline: none;
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
```
### Notes
- This CSS Custom Select is 18 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## OTP Code Input
> Boxed one-time-code inputs for verification and two-factor screens.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: otp, code, verification, pin, 2fa, input
- Live preview: https://copy-css.com/snippets/otp-input
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.otp {
display: flex;
gap: 10px;
}
.otp input {
box-sizing: border-box;
width: 46px;
height: 56px;
border: 1.5px solid #d1d5db;
border-radius: 12px;
background: #fff;
color: #111;
caret-color: #6366f1;
font: 700 22px system-ui, sans-serif;
text-align: center;
outline: none;
transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.otp input:focus {
border-color: #6366f1;
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
```
### Notes
- This CSS OTP Code Input is 24 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions, box shadows and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Star Rating
> A clickable five-star rating built from radio buttons, with hover preview.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: rating, stars, review, radio, has
- Live preview: https://copy-css.com/snippets/star-rating
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
/* Stars are listed 5 → 1 and displayed reversed */
.rating {
display: inline-flex;
flex-direction: row-reverse;
gap: 4px;
font-size: 34px;
line-height: 1;
}
.rating input {
position: absolute;
opacity: 0;
pointer-events: none;
}
.rating label {
color: #d1d5db;
cursor: pointer;
transition: color 0.15s ease, transform 0.15s ease;
}
.rating label:hover,
.rating label:hover ~ label,
.rating label:has(input:checked),
.rating label:has(input:checked) ~ label {
color: #f59e0b;
}
.rating label:hover {
transform: scale(1.15);
}
```
### Notes
- This CSS Star Rating is 31 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions, transforms, Flexbox and the :has() selector.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Radio Cards
> Large, clickable option cards built on real radio buttons, highlighted with :has().
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: radio, cards, choice, has, selection
- Live preview: https://copy-css.com/snippets/radio-cards
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.radio-cards {
display: flex;
gap: 10px;
font-family: system-ui, sans-serif;
}
.radio-cards label {
position: relative;
display: grid;
flex: 1 1 0;
gap: 2px;
min-width: 0;
padding: 14px 16px;
border: 2px solid #e2e8f0;
border-radius: 12px;
background: #fff;
cursor: pointer;
transition: border-color 0.15s ease, background 0.15s ease;
}
/* Keep the radio accessible but invisible */
.radio-cards input {
position: absolute;
opacity: 0;
}
.radio-cards strong {
color: #0f172a;
font-size: 15px;
}
.radio-cards span {
color: #64748b;
font-size: 13px;
}
.radio-cards label:has(:checked) {
border-color: #0ea5e9;
background: #f0f9ff;
}
.radio-cards label:has(:focus-visible) {
outline: 2px solid #0ea5e9;
outline-offset: 2px;
}
```
### Notes
- This CSS Radio Cards is 45 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, CSS Grid, Flexbox and the :has() selector.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## File Drop Zone
> A dashed upload area that wraps a real file input, so click and drop both work.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: file, upload, dropzone, input, dashed
- Live preview: https://copy-css.com/snippets/file-drop-zone
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.dropzone {
position: relative;
display: grid;
justify-items: center;
gap: 8px;
width: 260px;
padding: 26px 16px;
border: 2px dashed #cbd5e1;
border-radius: 14px;
background: #f8fafc;
color: #64748b;
font: 14px/1.4 system-ui, sans-serif;
text-align: center;
cursor: pointer;
transition: border-color 0.15s ease, background 0.15s ease;
}
/* The input covers the whole zone so files can be dropped anywhere on it */
.dropzone input {
position: absolute;
inset: 0;
opacity: 0;
cursor: pointer;
}
.dropzone b {
color: #7c3aed;
}
.dropzone:hover,
.dropzone:has(:focus-visible) {
border-color: #a78bfa;
background: #f5f3ff;
color: #6d28d9;
}
```
### Notes
- This CSS File Drop Zone is 35 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, CSS Grid, the :has() selector and keyboard focus styles.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Validated Input
> Shows a red error state only after the user has typed something invalid, with no JavaScript.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: validation, user-invalid, error, email, input
- Live preview: https://copy-css.com/snippets/validated-input
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.field-validate {
display: grid;
gap: 6px;
width: 240px;
font: 14px/1.3 system-ui, sans-serif;
color: #27272a;
}
.field-validate span {
font-weight: 600;
}
.field-validate input {
padding: 10px 12px;
border: 1.5px solid #d4d4d8;
border-radius: 10px;
background: #fff;
font: inherit;
outline: none;
transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-validate input:focus {
border-color: #6366f1;
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.field-validate small {
display: none;
color: #dc2626;
}
/* Invalid, but only once the field has text in it */
.field-validate input:invalid:not(:placeholder-shown) {
border-color: #dc2626;
box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.field-validate input:invalid:not(:placeholder-shown) + small {
display: block;
}
```
### Notes
- This CSS Validated Input is 41 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Checkbox Chips
> Toggleable filter chips made from checkboxes, with a check icon when selected.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: chips, tags, filter, checkbox, multi-select
- Live preview: https://copy-css.com/snippets/checkbox-chips
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.chips {
display: flex;
flex-wrap: wrap;
gap: 8px;
max-width: 280px;
margin: 0;
padding: 0;
border: 0;
font: 500 14px/1 system-ui, sans-serif;
}
.chips legend {
width: 100%;
margin-bottom: 10px;
color: #3f3f46;
font-weight: 700;
}
.chips label {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 14px;
border: 1.5px solid #e4e4e7;
border-radius: 999px;
color: #3f3f46;
cursor: pointer;
transition: all 0.15s ease;
}
.chips input {
flex: none;
color: inherit;
width: 0;
height: 14px;
margin: 0 -6px 0 0; /* hides the gap while unchecked */
border: 0;
background: currentColor;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
appearance: none;
transition: width 0.15s ease, margin 0.15s ease;
}
.chips label:has(:checked) {
border-color: #18181b;
background: #18181b;
color: #fff;
}
.chips input:checked {
width: 14px;
margin-right: 0;
}
.chips label:has(:focus-visible) {
outline: 2px solid #18181b;
outline-offset: 2px;
}
```
### Notes
- This CSS Checkbox Chips is 59 lines of pure CSS (1.5 KB) with no JavaScript and no dependencies. It uses transitions, masks, Flexbox and the :has() selector.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Newsletter Signup
> An email field with the subscribe button tucked inside, plus a focus ring around the whole thing.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: newsletter, subscribe, email, input, button, inline
- Live preview: https://copy-css.com/snippets/newsletter-input
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.subscribe {
display: flex;
width: 100%;
max-width: 340px;
padding: 5px;
border: 1px solid #e4e4e7;
border-radius: 999px;
background: #fff;
box-shadow: 0 6px 20px -12px rgba(0, 0, 0, 0.25);
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.subscribe:focus-within {
border-color: #6366f1;
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}
.subscribe input {
flex: 1;
min-width: 0;
padding: 0 14px;
border: 0;
outline: 0;
background: transparent;
color: #18181b;
font: 15px system-ui, sans-serif;
}
.subscribe button {
padding: 11px 18px;
border: 0;
border-radius: 999px;
background: #6366f1;
color: #fff;
font: 600 14px system-ui, sans-serif;
cursor: pointer;
transition: background 0.2s ease;
}
.subscribe button:hover {
background: #4f46e5;
}
.subscribe button:focus-visible {
outline: 2px solid #312e81;
outline-offset: 2px;
}
```
### Notes
- This CSS Newsletter Signup is 47 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, box shadows, Flexbox and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Custom Radio Buttons
> Restyled native radio buttons with a dot that pops in, using appearance: none.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: radio, custom, appearance, form, options
- Live preview: https://copy-css.com/snippets/custom-radio
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.radios {
display: grid;
gap: 12px;
color: #27272a;
font: 500 15px system-ui, sans-serif;
}
.radios label {
display: flex;
align-items: center;
gap: 10px;
cursor: pointer;
}
.radios input {
display: grid;
place-content: center;
width: 20px;
height: 20px;
margin: 0;
border: 2px solid #a1a1aa;
border-radius: 50%;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
transition: border-color 0.2s ease;
}
.radios input::before {
content: "";
width: 10px;
height: 10px;
border-radius: 50%;
background: #10b981;
transform: scale(0);
transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.6, 1);
}
.radios input:hover {
border-color: #71717a;
}
.radios input:checked {
border-color: #10b981;
}
.radios input:checked::before {
transform: scale(1);
}
.radios input:focus-visible {
outline: 2px solid #10b981;
outline-offset: 2px;
}
```
### Notes
- This CSS Custom Radio Buttons is 54 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, transforms, CSS Grid and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Day / Night Toggle
> A dark-mode switch where the sun slides across and turns into a crescent moon.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: dark mode, theme, toggle, switch, sun, moon, checkbox
- Live preview: https://copy-css.com/snippets/theme-toggle
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.theme-toggle {
position: relative;
display: inline-block;
width: 64px;
height: 34px;
}
.theme-toggle input {
position: absolute;
inset: 0;
z-index: 1;
margin: 0;
opacity: 0;
cursor: pointer;
}
.theme-toggle span {
position: absolute;
inset: 0;
border-radius: 999px;
background: #38bdf8;
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
transition: background 0.4s ease;
}
/* The sun */
.theme-toggle span::before {
content: "";
position: absolute;
top: 4px;
left: 4px;
width: 26px;
height: 26px;
border-radius: 50%;
background: #fde047;
box-shadow:
inset 0 0 0 0 #f8fafc,
0 0 10px 2px rgba(253, 224, 71, 0.6);
transition: transform 0.4s cubic-bezier(0.4, 1.4, 0.6, 1), background 0.4s ease, box-shadow 0.4s ease;
}
.theme-toggle input:checked + span {
background: #1e1b4b;
}
/* ...becomes the moon */
.theme-toggle input:checked + span::before {
background: rgba(253, 224, 71, 0);
box-shadow:
inset -9px -3px 0 0 #f8fafc,
0 0 10px 2px rgba(248, 250, 252, 0);
transform: translateX(30px);
}
.theme-toggle input:focus-visible + span {
outline: 2px solid #6366f1;
outline-offset: 3px;
}
```
### Notes
- This CSS Day / Night Toggle is 58 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and the :checked state (no JavaScript).
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Input with Prefix & Suffix
> A text field with attached prefix and suffix labels, like a currency sign and code.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: input group, addon, prefix, suffix, currency, price
- Live preview: https://copy-css.com/snippets/input-addon
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.addon {
display: flex;
width: 100%;
max-width: 260px;
overflow: hidden;
border: 1px solid #d4d4d8;
border-radius: 10px;
background: #fff;
font: 15px system-ui, sans-serif;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.addon:focus-within {
border-color: #0ea5e9;
box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}
.addon span {
display: flex;
align-items: center;
padding: 0 12px;
background: #f4f4f5;
color: #71717a;
}
.addon span:first-child {
border-right: 1px solid #e4e4e7;
}
.addon span:last-child {
border-left: 1px solid #e4e4e7;
font-size: 13px;
font-weight: 600;
}
.addon input {
flex: 1;
min-width: 0;
padding: 11px 12px;
border: 0;
outline: 0;
background: transparent;
color: #18181b;
font: inherit;
}
```
### Notes
- This CSS Input with Prefix & Suffix is 45 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, box shadows and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Color Swatch Picker
> Round color swatches for product variants, built on radio buttons with a ring around the chosen one.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: swatch, color, variant, radio, product, shop
- Live preview: https://copy-css.com/snippets/color-swatches
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.swatches {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin: 0;
padding: 0;
border: 0;
}
.swatches legend {
width: 100%;
margin-bottom: 12px;
padding: 0;
color: #3f3f46;
font: 700 14px system-ui, sans-serif;
}
/* Each label sets its own --c */
.swatches label {
position: relative;
width: 32px;
height: 32px;
border-radius: 50%;
background: var(--c);
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
cursor: pointer;
transition: box-shadow 0.2s ease;
}
.swatches input {
position: absolute;
inset: 0;
margin: 0;
opacity: 0;
cursor: pointer;
}
.swatches label:has(:checked) {
box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c);
}
.swatches label:has(:focus-visible) {
outline: 2px solid #6366f1;
outline-offset: 7px;
}
```
### Notes
- This CSS Color Swatch Picker is 45 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, box shadows, Flexbox and the :has() selector.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Expanding Search
> A round search icon that stretches into a full search field when it gets focus.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: search, expand, icon, focus, input, header
- Live preview: https://copy-css.com/snippets/expanding-search
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.search-expand {
box-sizing: border-box;
width: 44px;
height: 44px;
padding: 0 0 0 42px;
border: 1px solid #e2e8f0;
border-radius: 999px;
background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 13px 50% / 17px no-repeat;
color: #0f172a;
font: 15px system-ui, sans-serif;
-webkit-appearance: none;
appearance: none;
outline: none;
cursor: pointer;
transition: width 0.35s cubic-bezier(0.3, 0.7, 0.4, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}
/* Stay open while focused or while it has text */
.search-expand:focus,
.search-expand:not(:placeholder-shown) {
width: 220px;
padding-right: 14px;
border-color: #0ea5e9;
box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
cursor: text;
}
```
### Notes
- This CSS Expanding Search is 26 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Labeled Toggle Switch
> A toggle switch with ON and OFF text inside the track and a visible label, built on a role="switch" checkbox.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: toggle, switch, on off, role switch, checkbox, settings
- Live preview: https://copy-css.com/snippets/labeled-toggle-switch
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.tgl-text {
position: relative;
display: inline-flex;
align-items: center;
gap: 12px;
color: #0f172a;
font: 600 15px system-ui, sans-serif;
cursor: pointer;
}
.tgl-text input {
position: absolute;
opacity: 0;
pointer-events: none;
}
.tgl-text-track {
position: relative;
width: 64px;
height: 30px;
border-radius: 999px;
background: #cbd5e1;
transition: background 0.25s ease;
}
.tgl-text-track::before {
content: "";
position: absolute;
top: 3px;
left: 3px;
width: 24px;
height: 24px;
border-radius: 50%;
background: #fff;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
transition: transform 0.25s ease;
}
.tgl-text-track::after {
content: "OFF";
position: absolute;
top: 50%;
right: 9px;
color: #475569;
font-size: 10px;
font-weight: 800;
transform: translateY(-50%);
}
.tgl-text input:checked + .tgl-text-track {
background: #2563eb;
}
.tgl-text input:checked + .tgl-text-track::before {
transform: translateX(34px);
}
.tgl-text input:checked + .tgl-text-track::after {
content: "ON";
right: auto;
left: 11px;
color: #fff;
}
.tgl-text input:focus-visible + .tgl-text-track {
outline: 2px solid #2563eb;
outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
.tgl-text-track,
.tgl-text-track::before {
transition: none;
}
}
```
### Notes
- This CSS Labeled Toggle Switch is 75 lines of pure CSS (1.3 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Icon Toggle Switch
> A toggle switch whose knob shows a cross when off and a check mark when on, so state is not shown by color alone.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: toggle, switch, check icon, cross icon, checkbox, accessible
- Live preview: https://copy-css.com/snippets/icon-toggle-switch
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.tgl-icon {
position: relative;
display: inline-flex;
align-items: center;
gap: 10px;
color: #500724;
font: 500 15px system-ui, sans-serif;
cursor: pointer;
}
.tgl-icon input {
position: absolute;
opacity: 0;
pointer-events: none;
}
.tgl-icon-track {
position: relative;
width: 56px;
height: 32px;
border-radius: 999px;
background: #e4e4e7;
transition: background 0.3s ease;
}
.tgl-icon-track::before {
content: "✕";
position: absolute;
top: 4px;
left: 4px;
display: grid;
place-items: center;
width: 24px;
height: 24px;
border-radius: 50%;
background: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
color: #71717a;
font-size: 12px;
font-weight: 800;
transition: transform 0.3s cubic-bezier(0.4, 1.4, 0.6, 1);
}
.tgl-icon input:checked + .tgl-icon-track {
background: #db2777;
}
.tgl-icon input:checked + .tgl-icon-track::before {
content: "✓";
color: #db2777;
transform: translateX(24px);
}
.tgl-icon input:focus-visible + .tgl-icon-track {
outline: 2px solid #db2777;
outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
.tgl-icon-track,
.tgl-icon-track::before {
transition: none;
}
}
```
### Notes
- This CSS Icon Toggle Switch is 64 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Settings Toggle List
> A settings panel of rows with a title, a short description and a switch, where the whole row is clickable.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: settings, preferences, toggle, switch, list, notifications
- Live preview: https://copy-css.com/snippets/settings-toggle-list
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.settings-list {
width: 100%;
max-width: 300px;
margin: 0;
padding: 0;
overflow: hidden;
border: 1px solid #e4e4e7;
border-radius: 14px;
background: #fff;
color: #18181b;
font-family: system-ui, sans-serif;
}
.settings-list legend {
float: left;
width: 100%;
padding: 12px 16px 4px;
color: #71717a;
font-size: 12px;
font-weight: 700;
letter-spacing: 0.06em;
text-transform: uppercase;
}
.settings-list label {
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
clear: both;
padding: 10px 16px;
border-top: 1px solid #f4f4f5;
cursor: pointer;
}
.settings-list label:first-of-type {
border-top: 0;
}
.settings-list label:hover {
background: #fafafa;
}
.settings-list span {
display: grid;
color: #71717a;
font-size: 12px;
}
.settings-list strong {
color: #18181b;
font-size: 14px;
font-weight: 600;
}
.settings-list input {
position: relative;
flex: none;
width: 40px;
height: 24px;
margin: 0;
border-radius: 999px;
background: #d4d4d8;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
transition: background 0.2s ease;
}
.settings-list input::before {
content: "";
position: absolute;
top: 3px;
left: 3px;
width: 18px;
height: 18px;
border-radius: 50%;
background: #fff;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
transition: transform 0.2s ease;
}
.settings-list input:checked {
background: #16a34a;
}
.settings-list input:checked::before {
transform: translateX(16px);
}
.settings-list input:focus-visible {
outline: 2px solid #16a34a;
outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
.settings-list input,
.settings-list input::before {
transition: none;
}
}
```
### Notes
- This CSS Settings Toggle List is 101 lines of pure CSS (1.7 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Material Toggle Switch
> An Android-style switch made from a single input, with a slim track, an oversized thumb and a focus halo.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: material design, android, toggle, switch, single element, appearance
- Live preview: https://copy-css.com/snippets/material-toggle-switch
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.tgl-md {
display: inline-flex;
align-items: center;
gap: 14px;
color: #3b0764;
font: 500 15px system-ui, sans-serif;
cursor: pointer;
}
.tgl-md input {
position: relative;
width: 36px;
height: 14px;
margin: 0 4px;
border-radius: 999px;
background: #d4d4d8;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
transition: background 0.2s ease;
}
.tgl-md input::before {
content: "";
position: absolute;
top: 50%;
left: -4px;
width: 22px;
height: 22px;
border-radius: 50%;
background: #fafafa;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
transform: translateY(-50%);
transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.tgl-md input:checked {
background: #d8b4fe;
}
.tgl-md input:checked::before {
background: #7e22ce;
transform: translate(22px, -50%);
}
.tgl-md input:focus-visible {
outline: none;
}
.tgl-md input:focus-visible::before {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 10px rgba(126, 34, 206, 0.18);
}
@media (prefers-reduced-motion: reduce) {
.tgl-md input,
.tgl-md input::before {
transition: none;
}
}
```
### Notes
- This CSS Material Toggle Switch is 59 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Animated Checkbox
> A checkbox whose tick draws itself with an SVG stroke animation and a little bounce when checked.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: checkbox, animation, svg, stroke, draw, check mark
- Live preview: https://copy-css.com/snippets/animated-checkbox
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.check-draw {
position: relative;
display: inline-flex;
align-items: center;
gap: 10px;
color: #14532d;
font: 500 15px system-ui, sans-serif;
cursor: pointer;
}
.check-draw input {
flex: none;
width: 24px;
height: 24px;
margin: 0;
border: 2px solid #86efac;
border-radius: 7px;
background: #fff;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.check-draw input:checked {
border-color: #16a34a;
background: #16a34a;
animation: check-draw-pop 0.3s ease;
}
.check-draw input:focus-visible {
outline: 2px solid #16a34a;
outline-offset: 2px;
}
.check-draw svg {
position: absolute;
left: 3px;
width: 18px;
height: 18px;
fill: none;
stroke: #fff;
stroke-width: 3;
stroke-linecap: round;
stroke-linejoin: round;
stroke-dasharray: 22;
stroke-dashoffset: 22;
pointer-events: none;
transition: stroke-dashoffset 0.3s ease 0.05s;
}
.check-draw input:checked + svg {
stroke-dashoffset: 0;
}
@keyframes check-draw-pop {
50% {
transform: scale(1.15);
}
}
@media (prefers-reduced-motion: reduce) {
.check-draw input,
.check-draw svg {
transition: none;
animation: none;
}
}
```
### Notes
- This CSS Animated Checkbox is 68 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses keyframe animations, transitions, transforms and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## To-Do Checklist
> A to-do list with round checkboxes where finished tasks get a line drawn through them and fade out.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: todo, task list, checkbox, strikethrough, done, checklist
- Live preview: https://copy-css.com/snippets/todo-checklist
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.todo-list {
display: grid;
gap: 4px;
width: 240px;
margin: 0;
padding: 14px 16px;
border: 0;
border-radius: 14px;
background: #fff;
box-shadow: 0 6px 18px -10px rgba(113, 63, 18, 0.35);
color: #422006;
font-family: system-ui, sans-serif;
}
.todo-list legend {
float: left;
margin-bottom: 4px;
font-size: 16px;
font-weight: 800;
}
.todo-list label {
display: flex;
align-items: center;
gap: 10px;
padding: 6px 0;
font-size: 14px;
cursor: pointer;
}
.todo-list input {
display: grid;
flex: none;
place-items: center;
width: 20px;
height: 20px;
margin: 0;
border: 2px solid #facc15;
border-radius: 50%;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
}
.todo-list input::before {
content: "✓";
color: #fff;
font-size: 12px;
font-weight: 900;
transform: scale(0);
transition: transform 0.15s ease;
}
.todo-list input:checked {
border-color: #ca8a04;
background: #ca8a04;
}
.todo-list input:checked::before {
transform: scale(1);
}
.todo-list input:focus-visible {
outline: 2px solid #ca8a04;
outline-offset: 2px;
}
.todo-list span {
background: linear-gradient(#a16207, #a16207) no-repeat 0 55% / 0 1.5px;
transition: background-size 0.3s ease, color 0.3s ease;
}
.todo-list input:checked + span {
background-size: 100% 1.5px;
color: #a8a29e;
}
@media (prefers-reduced-motion: reduce) {
.todo-list span,
.todo-list input::before {
transition: none;
}
}
```
### Notes
- This CSS To-Do Checklist is 83 lines of pure CSS (1.4 KB) with no JavaScript and no dependencies. It uses transitions, transforms, linear gradients and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Checkbox Tiles
> Large icon tiles for picking several options at once, each a real checkbox with a corner check badge.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: checkbox, tiles, multi-select, icons, has, options grid
- Live preview: https://copy-css.com/snippets/checkbox-tiles
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.check-tiles {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
width: 100%;
max-width: 300px;
margin: 0;
padding: 0;
border: 0;
font-family: system-ui, sans-serif;
}
.check-tiles legend {
margin-bottom: 8px;
padding: 0;
color: #1e3a8a;
font-size: 14px;
font-weight: 700;
}
.check-tiles label {
position: relative;
display: grid;
justify-items: center;
gap: 6px;
padding: 14px 6px 12px;
border: 1.5px solid #dbeafe;
border-radius: 12px;
background: #fff;
color: #334155;
font-size: 13px;
font-weight: 600;
text-align: center;
cursor: pointer;
transition: border-color 0.2s ease, background 0.2s ease;
}
.check-tiles svg {
width: 26px;
height: 26px;
fill: none;
stroke: currentColor;
stroke-width: 1.8;
stroke-linecap: round;
stroke-linejoin: round;
}
.check-tiles input {
position: absolute;
top: 6px;
right: 6px;
display: grid;
place-items: center;
width: 18px;
height: 18px;
margin: 0;
border: 1.5px solid #bfdbfe;
border-radius: 50%;
-webkit-appearance: none;
appearance: none;
}
.check-tiles input:checked {
border-color: #2563eb;
background: #2563eb;
}
.check-tiles input:checked::before {
content: "✓";
color: #fff;
font-size: 11px;
font-weight: 900;
}
.check-tiles label:has(:checked) {
border-color: #2563eb;
background: #eff6ff;
color: #1d4ed8;
}
.check-tiles label:has(:focus-visible) {
outline: 2px solid #2563eb;
outline-offset: 2px;
}
```
### Notes
- This CSS Checkbox Tiles is 84 lines of pure CSS (1.5 KB) with no JavaScript and no dependencies. It uses transitions, CSS Grid, the :has() selector and the :checked state (no JavaScript).
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Terms Consent Checkbox
> A required "I agree to the terms" checkbox with a link, which turns red with a message only after a failed submit.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: terms, consent, agree, required, user-invalid, gdpr
- Live preview: https://copy-css.com/snippets/terms-consent-checkbox
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.consent {
display: grid;
gap: 10px;
width: 260px;
color: #1f2937;
font: 14px/1.45 system-ui, sans-serif;
}
.consent label {
display: flex;
align-items: flex-start;
gap: 10px;
cursor: pointer;
}
.consent input {
flex: none;
width: 18px;
height: 18px;
margin: 1px 0 0;
accent-color: #4f46e5;
cursor: pointer;
}
.consent input:focus-visible {
outline: 2px solid #4f46e5;
outline-offset: 2px;
}
.consent a {
color: #4f46e5;
font-weight: 600;
}
.consent a:focus-visible {
outline: 2px solid #4f46e5;
outline-offset: 2px;
border-radius: 2px;
}
.consent-error {
display: none;
margin: -4px 0 0 28px;
color: #dc2626;
font-size: 13px;
}
.consent:has(input:user-invalid) .consent-error {
display: block;
}
.consent input:user-invalid {
outline: 2px solid #dc2626;
outline-offset: 1px;
}
.consent button {
padding: 10px;
border: 0;
border-radius: 10px;
background: #4f46e5;
color: #fff;
font: 600 14px system-ui, sans-serif;
cursor: pointer;
}
.consent button:focus-visible {
outline: 2px solid #4f46e5;
outline-offset: 2px;
}
```
### Notes
- This CSS Terms Consent Checkbox is 70 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses CSS Grid, Flexbox, the :has() selector and keyboard focus styles.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Shipping Options Radio
> A stacked list of checkout shipping options with delivery times and prices, built on real radio buttons.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: radio, shipping, checkout, delivery, option list, has
- Live preview: https://copy-css.com/snippets/shipping-options-radio
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.ship-opts {
width: 100%;
max-width: 300px;
margin: 0;
padding: 0;
border: 0;
color: #0f172a;
font-family: system-ui, sans-serif;
}
.ship-opts legend {
margin-bottom: 8px;
padding: 0;
font-size: 14px;
font-weight: 700;
}
.ship-opts label {
position: relative;
display: flex;
align-items: center;
gap: 12px;
margin-top: -1px;
padding: 11px 14px;
border: 1px solid #e2e8f0;
background: #fff;
cursor: pointer;
}
.ship-opts label:first-of-type {
border-radius: 12px 12px 0 0;
}
.ship-opts label:last-of-type {
border-radius: 0 0 12px 12px;
}
.ship-opts label:has(:checked) {
z-index: 1;
border-color: #0ea5e9;
background: #f0f9ff;
}
.ship-opts input {
display: grid;
flex: none;
place-items: center;
width: 18px;
height: 18px;
margin: 0;
border: 2px solid #cbd5e1;
border-radius: 50%;
-webkit-appearance: none;
appearance: none;
}
.ship-opts input:checked {
border-color: #0ea5e9;
}
.ship-opts input:checked::before {
content: "";
width: 8px;
height: 8px;
border-radius: 50%;
background: #0ea5e9;
}
.ship-opts input:focus-visible {
outline: 2px solid #0ea5e9;
outline-offset: 2px;
}
.ship-opts span {
display: grid;
flex: 1;
color: #64748b;
font-size: 12px;
}
.ship-opts strong {
color: #0f172a;
font-size: 14px;
}
.ship-opts b {
font-size: 14px;
}
```
### Notes
- This CSS Shipping Options Radio is 88 lines of pure CSS (1.3 KB) with no JavaScript and no dependencies. It uses CSS Grid, Flexbox, the :has() selector and the :checked state (no JavaScript).
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Size Picker
> Clothing size buttons built on radios, with a filled selected state and a crossed-out sold-out size.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: size, variant, product options, radio, sold out, shop
- Live preview: https://copy-css.com/snippets/size-picker
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.size-pick {
display: flex;
flex-wrap: wrap;
gap: 8px;
max-width: 280px;
margin: 0;
padding: 0;
border: 0;
font-family: system-ui, sans-serif;
}
.size-pick legend {
margin-bottom: 8px;
padding: 0;
color: #1c1917;
font-size: 14px;
font-weight: 700;
}
.size-pick label {
position: relative;
display: grid;
place-items: center;
min-width: 44px;
height: 44px;
padding: 0 8px;
box-sizing: border-box;
border: 1.5px solid #d6d3d1;
border-radius: 10px;
background: #fff;
color: #1c1917;
font-size: 14px;
font-weight: 600;
cursor: pointer;
}
.size-pick input {
position: absolute;
opacity: 0;
pointer-events: none;
}
.size-pick label:hover {
border-color: #1c1917;
}
.size-pick label:has(:checked) {
border-color: #1c1917;
background: #1c1917;
color: #fff;
}
.size-pick label:has(:focus-visible) {
outline: 2px solid #1c1917;
outline-offset: 2px;
}
.size-pick label:has(:disabled) {
border-color: #e7e5e4;
background: linear-gradient(to top right, transparent calc(50% - 1px), #d6d3d1 0 calc(50% + 1px), transparent 0) #fafaf9;
color: #a8a29e;
cursor: not-allowed;
}
.size-pick small {
width: 100%;
color: #78716c;
font-size: 12px;
}
```
### Notes
- This CSS Size Picker is 69 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses linear gradients, CSS Grid, Flexbox and the :has() selector.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## NPS Rating Scale
> A 0 to 10 "how likely are you to recommend us" scale where the chosen score turns red, amber or green.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: nps, survey, rating, 0 to 10, feedback, radio, scale
- Live preview: https://copy-css.com/snippets/nps-rating-scale
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.nps-survey {
width: 100%;
min-width: 0;
max-width: 340px;
margin: 0;
padding: 0;
border: 0;
color: #0f172a;
font-family: system-ui, sans-serif;
}
.nps-survey legend {
margin-bottom: 10px;
padding: 0;
font-size: 14px;
font-weight: 600;
}
.nps-survey-scale {
display: grid;
grid-template-columns: repeat(11, minmax(0, 1fr));
gap: 3px;
}
.nps-survey-scale label {
position: relative;
display: grid;
place-items: center;
height: 34px;
border: 1px solid #e2e8f0;
border-radius: 6px;
background: #fff;
font-size: 13px;
font-weight: 600;
cursor: pointer;
}
.nps-survey-scale input {
position: absolute;
opacity: 0;
pointer-events: none;
}
.nps-survey-scale label:hover {
border-color: #94a3b8;
}
.nps-survey-scale label:nth-child(-n + 7):has(:checked) {
border-color: #ef4444;
background: #ef4444;
color: #fff;
}
.nps-survey-scale label:nth-child(n + 8):nth-child(-n + 9):has(:checked) {
border-color: #f59e0b;
background: #f59e0b;
color: #fff;
}
.nps-survey-scale label:nth-child(n + 10):has(:checked) {
border-color: #16a34a;
background: #16a34a;
color: #fff;
}
.nps-survey-scale label:has(:focus-visible) {
outline: 2px solid #0f172a;
outline-offset: 2px;
}
.nps-survey-ends {
display: flex;
justify-content: space-between;
margin: 6px 0 0;
color: #64748b;
font-size: 12px;
}
```
### Notes
- This CSS NPS Rating Scale is 77 lines of pure CSS (1.3 KB) with no JavaScript and no dependencies. It uses CSS Grid, Flexbox, the :has() selector and the :checked state (no JavaScript).
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Emoji Feedback Rating
> Five emoji faces for quick feedback, greyed out until one is picked, which then pops up in full color.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: emoji, feedback, rating, satisfaction, radio, survey
- Live preview: https://copy-css.com/snippets/emoji-feedback-rating
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.emoji-rate {
margin: 0;
padding: 16px 14px;
border: 0;
border-radius: 16px;
background: #fff;
font-family: system-ui, sans-serif;
text-align: center;
}
.emoji-rate legend {
float: left;
width: 100%;
margin-bottom: 10px;
padding: 0;
color: #431407;
font-size: 15px;
font-weight: 700;
text-align: center;
}
.emoji-rate label {
position: relative;
display: inline-grid;
place-items: center;
width: 40px;
height: 40px;
border-radius: 50%;
cursor: pointer;
}
.emoji-rate input {
position: absolute;
opacity: 0;
pointer-events: none;
}
.emoji-rate span {
font-size: 26px;
line-height: 1;
filter: grayscale(1);
opacity: 0.5;
transition: transform 0.2s cubic-bezier(0.4, 1.6, 0.6, 1), filter 0.2s ease, opacity 0.2s ease;
}
.emoji-rate label:hover span {
filter: grayscale(0.3);
opacity: 0.9;
}
.emoji-rate input:checked + span {
filter: none;
opacity: 1;
transform: scale(1.3);
}
.emoji-rate label:has(:checked) {
background: #ffedd5;
}
.emoji-rate label:has(:focus-visible) {
outline: 2px solid #ea580c;
outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
.emoji-rate span {
transition: none;
}
}
```
### Notes
- This CSS Emoji Feedback Rating is 70 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses transitions, transforms, filters and CSS Grid.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Outlined Floating Label
> A Material-style outlined input whose label shrinks into a notch on the top border when focused or filled.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: floating label, outlined, material, notch, input, placeholder-shown
- Live preview: https://copy-css.com/snippets/outlined-floating-label
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.outlined {
--accent: #0d9488;
position: relative;
display: block;
width: 240px;
font-family: system-ui, sans-serif;
}
.outlined input {
box-sizing: border-box;
width: 100%;
padding: 14px 14px;
border: 1.5px solid #a1a1aa;
border-radius: 8px;
background: #fff;
color: #18181b;
font: 16px system-ui, sans-serif;
outline: none;
transition: border-color 0.2s ease;
}
.outlined span {
position: absolute;
top: 50%;
left: 10px;
padding: 0 4px;
background: #fff;
color: #71717a;
font-size: 16px;
line-height: 1;
pointer-events: none;
transform: translateY(-50%);
transition: top 0.2s ease, font-size 0.2s ease, color 0.2s ease;
}
.outlined input:hover {
border-color: #52525b;
}
.outlined input:focus {
border-color: var(--accent);
box-shadow: inset 0 0 0 1px var(--accent);
}
.outlined input:focus + span,
.outlined input:not(:placeholder-shown) + span {
top: 0;
font-size: 12px;
}
.outlined input:focus + span {
color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
.outlined span {
transition: none;
}
}
```
### Notes
- This CSS Outlined Floating Label is 59 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and custom properties.
- Customize with: `--accent`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Input with Icon
> An email field with a leading mail icon that tints on focus and a green check that appears once the value is valid.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: icon, email, leading icon, valid, checkmark, input
- Live preview: https://copy-css.com/snippets/input-with-icon
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.icon-field {
display: grid;
gap: 6px;
width: 260px;
font-family: system-ui, sans-serif;
}
.icon-field-label {
color: #3b0764;
font-size: 13px;
font-weight: 600;
}
.icon-field-box {
position: relative;
display: block;
}
.icon-field svg {
position: absolute;
top: 50%;
left: 12px;
width: 18px;
height: 18px;
fill: none;
stroke: #a1a1aa;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
transform: translateY(-50%);
pointer-events: none;
transition: stroke 0.2s ease;
}
.icon-field input {
box-sizing: border-box;
width: 100%;
padding: 11px 38px 11px 40px;
border: 1.5px solid #ddd6fe;
border-radius: 10px;
background: #fff no-repeat right 12px center / 16px;
color: #18181b;
font: 15px system-ui, sans-serif;
outline: none;
}
.icon-field input:focus {
border-color: #7c3aed;
box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}
.icon-field-box:focus-within svg {
stroke: #7c3aed;
}
.icon-field input:valid:not(:placeholder-shown) {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E");
}
```
### Notes
- This CSS Input with Icon is 58 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Underline Input
> A minimal input with only a bottom border, where a colored line grows out from the center on focus.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: underline, minimal, focus line, animated border, input, clean
- Live preview: https://copy-css.com/snippets/underline-input
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.line-field {
position: relative;
display: grid;
width: 240px;
font-family: system-ui, sans-serif;
}
.line-field span {
color: #78716c;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
transition: color 0.2s ease;
}
.line-field input {
padding: 8px 0;
border: 0;
border-bottom: 1.5px solid #d6d3d1;
border-radius: 0;
background: transparent;
color: #1c1917;
font: 17px system-ui, sans-serif;
outline: none;
}
.line-field input::placeholder {
color: #a8a29e;
}
.line-field i {
position: absolute;
right: 0;
bottom: 0;
left: 0;
height: 2px;
background: #ea580c;
transform: scaleX(0);
transition: transform 0.3s ease;
}
.line-field input:focus + i {
transform: scaleX(1);
}
.line-field:focus-within span {
color: #ea580c;
}
@media (prefers-reduced-motion: reduce) {
.line-field i {
transition: none;
}
}
```
### Notes
- This CSS Underline Input is 55 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, transforms, CSS Grid and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Auto-Resize Textarea
> A textarea that grows with its content using field-sizing: content, capped at a max height, with no JavaScript.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: textarea, auto grow, field-sizing, comment box, message, resize
- Live preview: https://copy-css.com/snippets/auto-resize-textarea
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.grow-area {
display: grid;
gap: 6px;
width: 260px;
color: #0c4a6e;
font: 600 13px system-ui, sans-serif;
}
.grow-area textarea {
box-sizing: border-box;
width: 100%;
min-height: 3lh;
max-height: 8lh;
padding: 10px 12px;
border: 1.5px solid #bae6fd;
border-radius: 12px;
background: #fff;
color: #0f172a;
font: 400 15px/1.5 system-ui, sans-serif;
resize: vertical;
field-sizing: content;
}
.grow-area textarea:focus-visible {
border-color: #0284c7;
outline: none;
box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}
@supports (field-sizing: content) {
.grow-area textarea {
resize: none;
}
}
```
### Notes
- This CSS Auto-Resize Textarea is 34 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses field-sizing, box shadows, CSS Grid and keyboard focus styles.
- field-sizing: Chrome and Edge 123+ and Safari 26.2+. Firefox support is very recent; older browsers keep the field at a fixed size.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Input States
> Default, error and disabled text field states with helper and error text linked via aria-describedby.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: error, helper text, disabled, aria-invalid, design system, validation
- Live preview: https://copy-css.com/snippets/input-states
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.field-states {
display: grid;
gap: 12px;
width: 240px;
font-family: system-ui, sans-serif;
}
.field-states label {
display: grid;
gap: 4px;
color: #27272a;
font-size: 13px;
font-weight: 600;
}
.field-states input {
padding: 8px 11px;
border: 1.5px solid #d4d4d8;
border-radius: 8px;
background: #fff;
color: #18181b;
font: 14px system-ui, sans-serif;
}
.field-states input:focus-visible {
border-color: #2563eb;
outline: 3px solid rgba(37, 99, 235, 0.2);
outline-offset: 0;
}
.field-states small {
color: #71717a;
font-size: 12px;
font-weight: 400;
}
.field-states input[aria-invalid="true"] {
border-color: #dc2626;
}
.field-states input[aria-invalid="true"]:focus-visible {
outline-color: rgba(220, 38, 38, 0.2);
}
.field-states input[aria-invalid="true"] + small {
color: #dc2626;
}
.field-states input[aria-invalid="true"] + small::before {
content: "⚠ ";
}
.field-states input:disabled {
border-color: #e4e4e7;
background: #f4f4f5;
color: #a1a1aa;
cursor: not-allowed;
}
```
### Notes
- This CSS Input States is 58 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses CSS Grid and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Contact Form
> A tidy contact form with name and email side by side on wide screens, a message box and a send button.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: contact, form, message, textarea, responsive, grid
- Live preview: https://copy-css.com/snippets/contact-form
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.contact-form {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
gap: 10px;
width: 100%;
max-width: 340px;
padding: 16px;
box-sizing: border-box;
border-radius: 16px;
background: #fff;
font-family: system-ui, sans-serif;
}
.contact-form label {
display: grid;
gap: 4px;
color: #334155;
font-size: 12px;
font-weight: 600;
}
.contact-form-wide,
.contact-form button {
grid-column: 1 / -1;
}
.contact-form input,
.contact-form textarea {
box-sizing: border-box;
width: 100%;
padding: 8px 10px;
border: 1px solid #cbd5e1;
border-radius: 8px;
background: #f8fafc;
color: #0f172a;
font: 14px system-ui, sans-serif;
resize: vertical;
}
.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
border-color: #0f172a;
outline: 2px solid #0f172a;
outline-offset: -1px;
background: #fff;
}
.contact-form button {
padding: 10px;
border: 0;
border-radius: 8px;
background: #0f172a;
color: #fff;
font: 600 14px system-ui, sans-serif;
cursor: pointer;
}
.contact-form button:hover {
background: #334155;
}
.contact-form button:focus-visible {
outline: 2px solid #0f172a;
outline-offset: 2px;
}
```
### Notes
- This CSS Contact Form is 65 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses CSS Grid and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Floating Label Select
> A native select with a label that sits inside like a placeholder, then floats up once an option is chosen.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: select, floating label, dropdown, placeholder, invalid, form
- Live preview: https://copy-css.com/snippets/floating-label-select
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.float-select {
position: relative;
display: block;
width: 240px;
font-family: system-ui, sans-serif;
}
.float-select select {
box-sizing: border-box;
width: 100%;
height: 54px;
padding: 20px 40px 4px 14px;
border: 1.5px solid #a7f3d0;
border-radius: 10px;
background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
color: #064e3b;
font: 16px system-ui, sans-serif;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
}
.float-select span {
position: absolute;
top: 10px;
left: 15px;
color: #059669;
font-size: 12px;
pointer-events: none;
transition: top 0.2s ease, font-size 0.2s ease;
}
.float-select select:invalid + span {
top: 17px;
color: #6b7280;
font-size: 16px;
}
.float-select select:focus-visible {
border-color: #059669;
outline: none;
box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15);
}
@media (prefers-reduced-motion: reduce) {
.float-select span {
transition: none;
}
}
```
### Notes
- This CSS Floating Label Select is 49 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses transitions, box shadows, keyboard focus styles and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Inline Sort Select
> A borderless "Sort by" select that reads like part of the sentence, for product lists and search results.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: sort by, select, inline, filter, toolbar, minimal
- Live preview: https://copy-css.com/snippets/inline-sort-select
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.sort-by {
display: inline-flex;
align-items: center;
gap: 4px;
color: #71717a;
font: 14px system-ui, sans-serif;
}
.sort-by select {
padding: 4px 22px 4px 6px;
border: 0;
border-radius: 6px;
background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318181b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 4px center / 12px;
color: #18181b;
font: 600 14px system-ui, sans-serif;
-webkit-appearance: none;
appearance: none;
field-sizing: content;
cursor: pointer;
}
.sort-by select:hover {
background-color: #f4f4f5;
}
.sort-by select:focus-visible {
outline: 2px solid #18181b;
outline-offset: 1px;
}
```
### Notes
- This CSS Inline Sort Select is 29 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses field-sizing, Flexbox and keyboard focus styles.
- field-sizing: Chrome and Edge 123+ and Safari 26.2+. Firefox support is very recent; older browsers keep the field at a fixed size.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Styled Select Options
> A select whose open dropdown and options are fully styled with appearance: base-select, falling back to a native select.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: select, base-select, picker, dropdown, option styling, progressive enhancement
- Live preview: https://copy-css.com/snippets/styled-select-options
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.select-pick {
display: grid;
gap: 6px;
width: 220px;
color: #312e81;
font: 600 13px system-ui, sans-serif;
}
.select-pick select {
padding: 10px 12px;
border: 1.5px solid #c7d2fe;
border-radius: 10px;
background: #fff;
color: #1e1b4b;
font: 15px system-ui, sans-serif;
cursor: pointer;
}
.select-pick select:focus-visible {
border-color: #4f46e5;
outline: 3px solid rgba(79, 70, 229, 0.2);
outline-offset: 0;
}
/* Browsers that support customizable selects get a fully styled dropdown. */
.select-pick select,
.select-pick select::picker(select) {
appearance: base-select;
}
.select-pick select::picker(select) {
margin-top: 4px;
padding: 4px;
border: 1px solid #c7d2fe;
border-radius: 12px;
background: #fff;
box-shadow: 0 12px 30px -10px rgba(49, 46, 129, 0.35);
}
.select-pick option {
padding: 8px 10px;
border-radius: 8px;
color: #1e1b4b;
}
.select-pick option:hover,
.select-pick option:focus-visible {
background: #eef2ff;
outline: none;
}
.select-pick option:checked {
background: #4f46e5;
color: #fff;
font-weight: 600;
}
.select-pick option::checkmark {
content: "✓";
}
.select-pick select::picker-icon {
color: #4f46e5;
transition: rotate 0.2s ease;
}
.select-pick select:open::picker-icon {
rotate: 180deg;
}
```
### Notes
- This CSS Styled Select Options is 69 lines of pure CSS (1.3 KB) with no JavaScript and no dependencies. It uses customizable select (appearance: base-select), transitions, box shadows and CSS Grid.
- customizable select (appearance: base-select): Chrome and Edge 135+. Safari and Firefox are still rolling it out; without it you get a normal native select.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Language Select
> A compact language switcher: a native select with a globe icon on the left and a chevron on the right.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: language, locale, select, globe icon, i18n, footer
- Live preview: https://copy-css.com/snippets/language-select
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.lang-select {
position: relative;
display: inline-block;
font-family: system-ui, sans-serif;
}
.lang-select-sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.lang-select svg {
position: absolute;
top: 50%;
left: 12px;
width: 16px;
height: 16px;
fill: none;
stroke: #94a3b8;
stroke-width: 2;
transform: translateY(-50%);
pointer-events: none;
}
.lang-select select {
padding: 8px 32px 8px 36px;
border: 1px solid #334155;
border-radius: 999px;
background: #1e293b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px;
color: #e2e8f0;
font: 500 14px system-ui, sans-serif;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
}
.lang-select select:hover {
border-color: #475569;
}
.lang-select select:focus-visible {
outline: 2px solid #38bdf8;
outline-offset: 2px;
}
.lang-select option {
background: #1e293b;
color: #e2e8f0;
}
```
### Notes
- This CSS Language Select is 53 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses transforms, clip paths and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Range Slider with Ticks
> A stepped range slider that snaps to five values, with tick marks and labels drawn under the track.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: range, slider, ticks, steps, scale labels, input
- Live preview: https://copy-css.com/snippets/range-slider-ticks
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.range-ticks {
--thumb: 20px;
display: grid;
gap: 8px;
width: 260px;
color: #422006;
font: 600 13px system-ui, sans-serif;
}
.range-ticks input {
width: 100%;
height: var(--thumb);
margin: 0;
background:
linear-gradient(#fde68a, #fde68a) center / calc(100% - var(--thumb)) 4px no-repeat,
repeating-linear-gradient(90deg, #ca8a04 0 2px, transparent 0 calc((100% - 2px) / 4)) calc(var(--thumb) / 2 - 1px) 100% / calc(100% - var(--thumb) + 2px) 6px no-repeat;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
}
.range-ticks input::-webkit-slider-thumb {
width: var(--thumb);
height: var(--thumb);
border: 3px solid #ca8a04;
border-radius: 50%;
background: #fff;
-webkit-appearance: none;
appearance: none;
}
.range-ticks input::-moz-range-thumb {
box-sizing: border-box;
width: var(--thumb);
height: var(--thumb);
border: 3px solid #ca8a04;
border-radius: 50%;
background: #fff;
}
.range-ticks input:focus-visible {
outline: 2px solid #ca8a04;
outline-offset: 4px;
}
.range-ticks-scale {
display: flex;
justify-content: space-between;
margin: 0 calc(var(--thumb) / 2 - 8px);
color: #a16207;
font-size: 11px;
font-weight: 500;
}
.range-ticks-scale span {
width: 16px;
text-align: center;
}
```
### Notes
- This CSS Range Slider with Ticks is 58 lines of pure CSS (1.3 KB) with no JavaScript and no dependencies. It uses linear gradients, CSS Grid, Flexbox and keyboard focus styles.
- Customize with: `--thumb`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Filled Range Slider
> A thick range slider that fills with color up to the thumb in every browser, using a clipped box-shadow trick.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: range, slider, fill, progress, volume, no javascript
- Live preview: https://copy-css.com/snippets/filled-range-slider
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.range-fill {
--fill: #0284c7;
display: grid;
gap: 8px;
width: 240px;
color: #0c4a6e;
font: 600 13px system-ui, sans-serif;
}
.range-fill input {
height: 16px;
margin: 0;
overflow: hidden;
border-radius: 999px;
background: #e0f2fe;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
}
.range-fill input::-webkit-slider-thumb {
width: 16px;
height: 16px;
border: 3px solid var(--fill);
border-radius: 50%;
background: #fff;
box-shadow: -408px 0 0 400px var(--fill);
-webkit-appearance: none;
appearance: none;
}
.range-fill input::-moz-range-thumb {
box-sizing: border-box;
width: 16px;
height: 16px;
border: 3px solid var(--fill);
border-radius: 50%;
background: #fff;
}
.range-fill input::-moz-range-progress {
height: 16px;
background: var(--fill);
}
.range-fill input:focus-visible {
outline: 2px solid var(--fill);
outline-offset: 3px;
}
```
### Notes
- This CSS Filled Range Slider is 49 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses box shadows, CSS Grid, keyboard focus styles and custom properties.
- Customize with: `--fill`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Vertical Range Slider
> A tall, pill-shaped vertical slider like a phone brightness control, made with writing-mode on a range input.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: range, vertical, writing-mode, brightness, control center, slider
- Live preview: https://copy-css.com/snippets/vertical-range-slider
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.range-tall {
--fill: #f8fafc;
width: 56px;
height: 150px;
margin: 0;
overflow: hidden;
border-radius: 20px;
background: rgba(148, 163, 184, 0.35);
writing-mode: vertical-lr;
direction: rtl;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
}
.range-tall::-webkit-slider-thumb {
width: 56px;
height: 2px;
background: var(--fill);
box-shadow: 0 300px 0 300px var(--fill);
-webkit-appearance: none;
appearance: none;
}
.range-tall::-moz-range-thumb {
width: 56px;
height: 2px;
border: 0;
border-radius: 0;
background: var(--fill);
}
.range-tall::-moz-range-progress {
width: 56px;
background: var(--fill);
}
.range-tall:focus-visible {
outline: 3px solid #38bdf8;
outline-offset: 3px;
}
```
### Notes
- This CSS Vertical Range Slider is 41 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses box shadows, keyboard focus styles and custom properties.
- Customize with: `--fill`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Price Range Slider
> A dual-handle price filter built from two stacked range inputs where only the thumbs catch the pointer.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: dual range, min max, price filter, two thumbs, slider, ecommerce
- Live preview: https://copy-css.com/snippets/price-range-slider
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.price-range {
--thumb: 20px;
width: 260px;
margin: 0;
padding: 0;
border: 0;
color: #4a044e;
font-family: system-ui, sans-serif;
}
.price-range legend {
margin-bottom: 8px;
padding: 0;
font-size: 14px;
font-weight: 700;
}
.price-range-track {
position: relative;
height: var(--thumb);
}
.price-range-track::before {
content: "";
position: absolute;
top: 50%;
right: calc(var(--thumb) / 2);
left: calc(var(--thumb) / 2);
height: 4px;
border-radius: 999px;
background: #f5d0fe;
transform: translateY(-50%);
}
.price-range input {
position: absolute;
inset: 0;
width: 100%;
height: var(--thumb);
margin: 0;
background: none;
-webkit-appearance: none;
appearance: none;
pointer-events: none;
}
.price-range input::-webkit-slider-thumb {
width: var(--thumb);
height: var(--thumb);
border: 0;
border-radius: 50%;
background: #c026d3;
box-shadow: 0 0 0 4px #fff, 0 2px 6px 4px rgba(112, 26, 117, 0.25);
-webkit-appearance: none;
appearance: none;
pointer-events: auto;
cursor: grab;
}
.price-range input::-moz-range-thumb {
width: var(--thumb);
height: var(--thumb);
border: 0;
border-radius: 50%;
background: #c026d3;
box-shadow: 0 0 0 4px #fff, 0 2px 6px 4px rgba(112, 26, 117, 0.25);
pointer-events: auto;
cursor: grab;
}
.price-range input:focus-visible {
outline: none;
}
.price-range input:focus-visible::-webkit-slider-thumb {
box-shadow: 0 0 0 4px #fff, 0 0 0 6px #c026d3;
}
.price-range input:focus-visible::-moz-range-thumb {
box-shadow: 0 0 0 4px #fff, 0 0 0 6px #c026d3;
}
.price-range p {
display: flex;
justify-content: space-between;
margin: 8px 0 0;
color: #a21caf;
font-size: 12px;
}
```
### Notes
- This CSS Price Range Slider is 89 lines of pure CSS (1.7 KB) with no JavaScript and no dependencies. It uses transforms, box shadows, Flexbox and keyboard focus styles.
- Customize with: `--thumb`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Search with Recent Items
> A search field that opens a panel of recent searches while it has focus, using :focus-within and no JavaScript.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: search, recent searches, dropdown, focus-within, suggestions, panel
- Live preview: https://copy-css.com/snippets/search-recent-dropdown
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.search-recent {
position: relative;
width: 260px;
font-family: system-ui, sans-serif;
}
.search-recent-sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.search-recent input {
box-sizing: border-box;
width: 100%;
padding: 11px 14px 11px 40px;
border: 1.5px solid #e2e8f0;
border-radius: 12px;
background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center / 17px;
color: #0f172a;
font: 15px system-ui, sans-serif;
outline: none;
}
.search-recent input:focus {
border-color: #6366f1;
}
.search-recent-panel {
position: absolute;
top: calc(100% + 6px);
right: 0;
left: 0;
z-index: 10;
display: grid;
padding: 6px;
border: 1px solid #e2e8f0;
border-radius: 12px;
background: #fff;
box-shadow: 0 16px 32px -12px rgba(15, 23, 42, 0.25);
opacity: 0;
visibility: hidden;
transform: translateY(-4px);
transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.search-recent:focus-within .search-recent-panel {
opacity: 1;
visibility: visible;
transform: none;
}
.search-recent-panel p {
margin: 4px 8px;
color: #94a3b8;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
}
.search-recent-panel a {
padding: 7px 8px;
border-radius: 8px;
color: #334155;
font-size: 14px;
text-decoration: none;
}
.search-recent-panel a:hover,
.search-recent-panel a:focus-visible {
background: #eef2ff;
color: #4338ca;
outline: none;
}
```
### Notes
- This CSS Search with Recent Items is 77 lines of pure CSS (1.7 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and clip paths.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Command Search Bar
> A docs-style search bar with a ⌘K shortcut hint that hides itself once you focus the field or start typing.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: search, command palette, keyboard shortcut, kbd, cmd k, docs
- Live preview: https://copy-css.com/snippets/command-search-bar
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.cmd-search {
position: relative;
width: 240px;
font-family: system-ui, sans-serif;
}
.cmd-search input {
box-sizing: border-box;
width: 100%;
padding: 9px 52px 9px 36px;
border: 1px solid #3f3f46;
border-radius: 10px;
background: #27272a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center / 16px;
color: #fafafa;
font: 14px system-ui, sans-serif;
outline: none;
transition: border-color 0.2s ease, background-color 0.2s ease;
}
.cmd-search input::placeholder {
color: #a1a1aa;
}
.cmd-search input:hover {
border-color: #52525b;
}
.cmd-search input:focus-visible {
border-color: #a78bfa;
background-color: #18181b;
box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.25);
}
.cmd-search kbd {
position: absolute;
top: 50%;
right: 8px;
padding: 2px 6px;
border: 1px solid #52525b;
border-radius: 6px;
color: #a1a1aa;
font: 600 11px system-ui, sans-serif;
pointer-events: none;
transform: translateY(-50%);
transition: opacity 0.15s ease;
}
.cmd-search input:focus ~ kbd,
.cmd-search input:not(:placeholder-shown) ~ kbd {
opacity: 0;
}
```
### Notes
- This CSS Command Search Bar is 51 lines of pure CSS (1.3 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Search with Category
> A marketplace search bar that joins a category select, a search field and a search button into one pill.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: search, category, select, marketplace, input group, button
- Live preview: https://copy-css.com/snippets/category-search-bar
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.cat-search {
display: flex;
width: 100%;
max-width: 320px;
overflow: hidden;
border: 2px solid #f97316;
border-radius: 12px;
background: #fff;
font-family: system-ui, sans-serif;
}
.cat-search:focus-within {
box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2);
}
.cat-search select {
padding: 0 24px 0 12px;
border: 0;
border-right: 1px solid #fed7aa;
background: #fff7ed url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a3412' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 10px;
color: #7c2d12;
font: 600 13px system-ui, sans-serif;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
}
.cat-search input {
flex: 1;
min-width: 0;
padding: 10px 12px;
border: 0;
background: transparent;
color: #1c1917;
font: 15px system-ui, sans-serif;
}
.cat-search button {
display: grid;
place-items: center;
width: 46px;
border: 0;
background: #f97316;
color: #fff;
cursor: pointer;
}
.cat-search button:hover {
background: #ea580c;
}
.cat-search svg {
width: 18px;
height: 18px;
fill: none;
stroke: currentColor;
stroke-width: 2.5;
stroke-linecap: round;
}
.cat-search select:focus-visible,
.cat-search input:focus-visible,
.cat-search button:focus-visible {
outline: 2px solid #9a3412;
outline-offset: -3px;
}
```
### Notes
- This CSS Search with Category is 66 lines of pure CSS (1.4 KB) with no JavaScript and no dependencies. It uses box shadows, CSS Grid, Flexbox and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Styled File Input
> A native file input restyled with ::file-selector-button, keeping the browser's own file name display.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: file input, upload, file-selector-button, attachment, browse, form
- Live preview: https://copy-css.com/snippets/styled-file-input
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.file-pick {
display: grid;
gap: 6px;
width: 100%;
max-width: 280px;
color: #0f172a;
font: 600 13px system-ui, sans-serif;
}
.file-pick input {
min-width: 0;
padding: 6px;
border: 1.5px dashed #cbd5e1;
border-radius: 10px;
background: #fff;
color: #64748b;
font: 13px system-ui, sans-serif;
cursor: pointer;
}
.file-pick input::file-selector-button {
margin-right: 10px;
padding: 7px 12px;
border: 0;
border-radius: 7px;
background: #0f172a;
color: #fff;
font: 600 13px system-ui, sans-serif;
cursor: pointer;
transition: background 0.2s ease;
}
.file-pick input:hover::file-selector-button {
background: #334155;
}
.file-pick input:focus-visible {
border-color: #0f172a;
outline: 2px solid #0f172a;
outline-offset: 2px;
}
.file-pick small {
color: #64748b;
font-size: 12px;
font-weight: 400;
}
```
### Notes
- This CSS Styled File Input is 47 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, CSS Grid and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Avatar Upload
> A round profile-photo picker with a camera badge, where the whole circle is a label for a hidden file input.
- Category: [CSS Form Elements](https://copy-css.com/category/forms)
- Tags: avatar, profile photo, upload, file input, camera, circle
- Live preview: https://copy-css.com/snippets/avatar-upload
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.avatar-up {
position: relative;
display: grid;
justify-items: center;
gap: 8px;
color: #0f766e;
font: 600 13px system-ui, sans-serif;
cursor: pointer;
}
.avatar-up input {
position: absolute;
width: 1px;
height: 1px;
opacity: 0;
}
.avatar-up-photo {
display: grid;
place-items: end center;
width: 88px;
height: 88px;
overflow: hidden;
border: 2px dashed #5eead4;
border-radius: 50%;
background: #ccfbf1;
transition: border-color 0.2s ease;
}
.avatar-up-photo svg {
width: 70px;
height: 70px;
fill: #99f6e4;
stroke: #5eead4;
stroke-width: 1;
}
.avatar-up-badge {
position: absolute;
top: 60px;
left: calc(50% + 18px);
display: grid;
place-items: center;
width: 30px;
height: 30px;
border: 3px solid #f0fdfa;
border-radius: 50%;
background: #0d9488;
transition: transform 0.2s ease;
}
.avatar-up-badge svg {
width: 15px;
height: 15px;
fill: none;
stroke: #fff;
stroke-width: 2;
stroke-linejoin: round;
}
.avatar-up:hover .avatar-up-photo {
border-color: #0d9488;
}
.avatar-up:hover .avatar-up-badge {
transform: scale(1.1);
}
.avatar-up:has(:focus-visible) .avatar-up-photo {
outline: 3px solid #0d9488;
outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
.avatar-up-badge {
transition: none;
}
}
```
### Notes
- This CSS Avatar Upload is 78 lines of pure CSS (1.3 KB) with no JavaScript and no dependencies. It uses transitions, transforms, CSS Grid and the :has() selector.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
# CSS Navigation
Tabs, breadcrumbs, pagination, dropdowns and nav bars, built with plain HTML and CSS.
## Pure CSS Tabs
> Working tabs with panels and no JavaScript, powered by radio buttons and :has().
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: tabs, radio, has, panels, no javascript
- Live preview: https://copy-css.com/snippets/css-tabs
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
A quick overview of the product.
Dimensions, materials and more.
4.8 out of 5 from 120 reviews.
```
### CSS
```css
.tabs {
width: 280px;
font: 14px/1.5 system-ui, sans-serif;
}
.tab-list {
display: flex;
gap: 4px;
border-bottom: 1px solid #e5e7eb;
}
.tab-list label {
margin-bottom: -1px;
padding: 10px 14px;
color: #6b7280;
font-weight: 600;
cursor: pointer;
}
.tab-list input {
position: absolute;
opacity: 0;
pointer-events: none;
}
.tab-list label:has(input:checked) {
color: #111;
box-shadow: inset 0 -2px 0 #6366f1;
}
.tab-list label:has(input:focus-visible) {
border-radius: 6px;
outline: 2px solid #6366f1;
}
.tab-panels > div {
display: none;
padding: 14px 2px;
color: #374151;
}
.tabs:has(label:nth-child(1) input:checked) .tab-panels > :nth-child(1),
.tabs:has(label:nth-child(2) input:checked) .tab-panels > :nth-child(2),
.tabs:has(label:nth-child(3) input:checked) .tab-panels > :nth-child(3) {
display: block;
}
```
### Notes
- This CSS Tabs is 46 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses box shadows, Flexbox, the :has() selector and the :checked state (no JavaScript).
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Breadcrumbs
> Accessible breadcrumb navigation with CSS-generated separators.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: breadcrumbs, navigation, seo, list, separator
- Live preview: https://copy-css.com/snippets/breadcrumbs
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.breadcrumbs ol {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
margin: 0;
padding: 0;
list-style: none;
font: 500 15px system-ui, sans-serif;
}
.breadcrumbs li + li::before {
content: "/";
margin-right: 8px;
color: #cbd5e1;
}
.breadcrumbs a {
color: #64748b;
text-decoration: none;
}
.breadcrumbs a:hover {
color: #111;
text-decoration: underline;
}
.breadcrumbs [aria-current] {
color: #111;
font-weight: 600;
}
```
### Notes
- This CSS Breadcrumbs is 31 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Pagination
> Rounded pagination buttons with a clear current page and ellipsis.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: pagination, pages, navigation, buttons
- Live preview: https://copy-css.com/snippets/pagination
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.pagination {
display: flex;
gap: 6px;
font: 600 14px system-ui, sans-serif;
}
.pagination a,
.pagination span {
display: grid;
place-items: center;
box-sizing: border-box;
min-width: 36px;
height: 36px;
padding: 0 6px;
border-radius: 10px;
color: #374151;
text-decoration: none;
}
.pagination a {
border: 1px solid #e5e7eb;
background: #fff;
transition: border-color 0.15s ease;
}
.pagination a:hover {
border-color: #111;
}
.pagination [aria-current="page"] {
border-color: #111;
background: #111;
color: #fff;
}
.pagination span {
color: #9ca3af;
}
```
### Notes
- This CSS Pagination is 38 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, CSS Grid and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Dropdown Menu
> A dropdown that opens on hover and on keyboard focus. No JavaScript.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: dropdown, menu, hover, focus-within, navigation
- Live preview: https://copy-css.com/snippets/dropdown-menu
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.dropdown {
position: relative;
display: inline-block;
font: 500 15px system-ui, sans-serif;
}
.dropdown-toggle {
padding: 10px 16px;
border: 1px solid #e5e7eb;
border-radius: 10px;
background: #fff;
color: #111;
font: inherit;
cursor: pointer;
}
.dropdown-menu {
position: absolute;
top: calc(100% + 8px);
left: 0;
min-width: 170px;
margin: 0;
padding: 6px;
list-style: none;
border: 1px solid #e5e7eb;
border-radius: 12px;
background: #fff;
box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.18);
opacity: 0;
visibility: hidden;
transform: translateY(-6px);
transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
/* Invisible bridge so the menu stays open while the pointer crosses the gap */
.dropdown-menu::before {
content: "";
position: absolute;
top: -10px;
right: 0;
left: 0;
height: 10px;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
opacity: 1;
visibility: visible;
transform: none;
}
.dropdown-menu a {
display: block;
padding: 8px 12px;
border-radius: 8px;
color: #111;
text-decoration: none;
}
.dropdown-menu a:hover {
background: #f3f4f6;
}
```
### Notes
- This CSS Dropdown Menu is 62 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses transitions, transforms and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Underline Nav Links
> Header navigation links with an underline that grows in on hover and marks the active page.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: nav, links, underline, active, header
- Live preview: https://copy-css.com/snippets/underline-nav
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.nav-links {
display: flex;
gap: 22px;
font: 600 16px system-ui, sans-serif;
}
.nav-links a {
position: relative;
padding: 6px 0;
color: #64748b;
text-decoration: none;
transition: color 0.2s ease;
}
.nav-links a::after {
content: "";
position: absolute;
right: 0;
bottom: 0;
left: 0;
height: 2px;
border-radius: 2px;
background: #6366f1;
transform: scaleX(0);
transition: transform 0.25s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
color: #111;
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
transform: scaleX(1);
}
```
### Notes
- This CSS Underline Nav Links is 36 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, transforms and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Mobile Tab Bar
> An app-style bottom navigation bar with icons, labels and an active pill.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: mobile, tab bar, bottom navigation, icons, app
- Live preview: https://copy-css.com/snippets/mobile-tab-bar
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.tab-bar {
display: flex;
width: 280px;
padding: 8px;
border-radius: 20px;
background: #fff;
box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.2);
font: 600 11px system-ui, sans-serif;
}
.tab-bar a {
display: flex;
flex: 1;
flex-direction: column;
align-items: center;
gap: 4px;
padding: 8px 0;
border-radius: 14px;
color: #94a3b8;
text-decoration: none;
transition: background 0.2s ease, color 0.2s ease;
}
.tab-bar svg {
width: 22px;
height: 22px;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
}
.tab-bar a:hover {
color: #4f46e5;
}
.tab-bar a[aria-current="page"] {
background: #eef2ff;
color: #4f46e5;
}
```
### Notes
- This CSS Mobile Tab Bar is 41 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, box shadows and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Progress Stepper
> A numbered step indicator for checkouts and wizards, with done, current and upcoming states.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: steps, wizard, checkout, progress, counter
- Live preview: https://copy-css.com/snippets/stepper
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Cart
Shipping
Payment
```
### CSS
```css
.stepper {
display: flex;
margin: 0;
padding: 0;
list-style: none;
counter-reset: step;
font: 600 13px/1 system-ui, sans-serif;
}
.stepper li {
position: relative;
display: grid;
justify-items: center;
gap: 8px;
width: 90px;
color: #94a3b8;
counter-increment: step;
}
/* Number bubble */
.stepper li::before {
content: counter(step);
z-index: 1;
display: grid;
place-items: center;
width: 30px;
height: 30px;
border: 2px solid #cbd5e1;
border-radius: 50%;
background: #fff;
}
/* Connector line to the previous step */
.stepper li + li::after {
content: "";
position: absolute;
top: 15px;
right: 50%;
width: 100%;
height: 2px;
background: #e2e8f0;
}
.stepper .done,
.stepper [aria-current] {
color: #0f172a;
}
.stepper .done::before {
content: "\2713";
border-color: #10b981;
background: #10b981;
color: #fff;
}
.stepper [aria-current]::before {
border-color: #10b981;
color: #10b981;
}
.stepper [aria-current]::after {
background: #10b981;
}
```
### Notes
- This CSS Progress Stepper is 63 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses CSS Grid and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Vertical Side Nav
> A dashboard side menu with an accent bar on the active item.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: sidebar, menu, vertical, active, dashboard
- Live preview: https://copy-css.com/snippets/vertical-nav
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.side-nav {
display: grid;
gap: 2px;
width: 180px;
padding: 8px;
border-radius: 14px;
background: #fff;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
font: 500 14px/1 system-ui, sans-serif;
}
.side-nav a {
position: relative;
padding: 10px 14px;
border-radius: 8px;
color: #475569;
text-decoration: none;
transition: background 0.15s ease, color 0.15s ease;
}
.side-nav a:hover {
background: #f1f5f9;
color: #0f172a;
}
.side-nav a[aria-current="page"] {
background: #eef2ff;
color: #4338ca;
font-weight: 600;
}
.side-nav a[aria-current="page"]::before {
content: "";
position: absolute;
top: 8px;
bottom: 8px;
left: 0;
width: 3px;
border-radius: 0 3px 3px 0;
background: #4f46e5;
}
```
### Notes
- This CSS Vertical Side Nav is 41 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Pill Nav
> A rounded navigation bar where the current link sits in a solid pill.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: pill, nav, links, rounded, active
- Live preview: https://copy-css.com/snippets/pill-nav
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.pill-nav {
display: inline-flex;
gap: 4px;
padding: 5px;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 999px;
background: #27272a;
font: 500 14px/1 system-ui, sans-serif;
}
.pill-nav a {
padding: 9px 16px;
border-radius: 999px;
color: #a1a1aa;
text-decoration: none;
transition: color 0.15s ease, background 0.15s ease;
}
.pill-nav a:hover {
color: #fafafa;
}
.pill-nav a[aria-current="page"] {
background: #fafafa;
color: #18181b;
}
```
### Notes
- This CSS Pill Nav is 26 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Back to Top Button
> A floating round button that smoothly scrolls the page back to the top.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: scroll, top, fixed, smooth scroll, anchor
- Live preview: https://copy-css.com/snippets/back-to-top
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
/* Smooth scrolling for anchor links (respects reduced motion) */
@media (prefers-reduced-motion: no-preference) {
html { scroll-behavior: smooth; }
}
.to-top {
position: fixed;
right: 24px;
bottom: 24px;
display: grid;
place-items: center;
width: 48px;
height: 48px;
border-radius: 50%;
background: #0d9488;
box-shadow: 0 8px 20px -6px rgba(13, 148, 136, 0.6);
color: #fff;
transition: transform 0.2s ease, background 0.2s ease;
}
.to-top:hover {
background: #0f766e;
transform: translateY(-3px);
}
```
### Notes
- This CSS Back to Top Button is 24 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Table of Contents
> A docs-style "On this page" list with automatic 1, 1.1, 1.2 numbering from CSS counters.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: toc, contents, counters, docs, sidebar, numbered
- Live preview: https://copy-css.com/snippets/table-of-contents
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.toc {
font: 14px/1.4 system-ui, sans-serif;
}
.toc ol {
margin: 0;
padding: 0;
list-style: none;
counter-reset: toc;
}
.toc li {
counter-increment: toc;
}
.toc a {
display: flex;
gap: 8px;
padding: 5px 14px;
border-left: 2px solid #e4e4e7;
color: #52525b;
text-decoration: none;
transition: color 0.2s ease, border-color 0.2s ease;
}
/* 1, 1.1, 1.2, 2 ... */
.toc a::before {
content: counters(toc, ".");
color: #a1a1aa;
font-variant-numeric: tabular-nums;
}
.toc ol ol a {
padding-left: 28px;
}
.toc a:hover {
color: #18181b;
}
.toc a[aria-current] {
border-color: #2563eb;
color: #2563eb;
font-weight: 600;
}
.toc a[aria-current]::before {
color: inherit;
}
```
### Notes
- This CSS Table of Contents is 49 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Sliding Hover Nav
> Nav links with one highlight that slides to whichever link you hover, using :has(). No JavaScript.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: nav, has, indicator, hover, slide, highlight
- Live preview: https://copy-css.com/snippets/sliding-indicator-nav
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.slide-nav {
--n: 4; /* number of links */
--i: 0; /* index of the highlighted link */
position: relative;
display: grid;
grid-auto-columns: 1fr;
grid-auto-flow: column;
padding: 4px;
border: 1px solid #e0e7ff;
border-radius: 12px;
font: 600 14px system-ui, sans-serif;
}
.slide-nav::before {
content: "";
position: absolute;
top: 4px;
bottom: 4px;
left: 4px;
width: calc((100% - 8px) / var(--n));
border-radius: 8px;
background: #e0e7ff;
transform: translateX(calc(var(--i) * 100%));
transition: transform 0.3s cubic-bezier(0.3, 0.7, 0.4, 1);
}
.slide-nav a {
position: relative;
padding: 9px 16px;
color: #64748b;
text-align: center;
text-decoration: none;
transition: color 0.2s ease;
}
.slide-nav a:hover,
.slide-nav a:focus-visible,
.slide-nav:not(:hover) a[aria-current] {
color: #3730a3;
}
.slide-nav a:focus-visible {
outline: 2px solid #6366f1;
border-radius: 8px;
}
/* Rest on the current page... */
.slide-nav:has(> :nth-child(2)[aria-current]) { --i: 1; }
.slide-nav:has(> :nth-child(3)[aria-current]) { --i: 2; }
.slide-nav:has(> :nth-child(4)[aria-current]) { --i: 3; }
/* ...and follow the pointer or keyboard focus */
.slide-nav:has(> :nth-child(1):is(:hover, :focus-visible)) { --i: 0; }
.slide-nav:has(> :nth-child(2):is(:hover, :focus-visible)) { --i: 1; }
.slide-nav:has(> :nth-child(3):is(:hover, :focus-visible)) { --i: 2; }
.slide-nav:has(> :nth-child(4):is(:hover, :focus-visible)) { --i: 3; }
```
### Notes
- This CSS Sliding Hover Nav is 56 lines of pure CSS (1.4 KB) with no JavaScript and no dependencies. It uses transitions, transforms, CSS Grid and the :has() selector.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- Customize with: `--n`, `--i`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Carousel Dots
> Slide indicator dots where the active one stretches into a pill. Built on radio buttons, so it works with the keyboard.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: dots, carousel, slider, indicator, pagination, radio
- Live preview: https://copy-css.com/snippets/carousel-dots
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.carousel-dots {
display: flex;
gap: 8px;
padding: 10px 12px;
border-radius: 999px;
background: #f1f5f9;
}
.carousel-dots input {
width: 10px;
height: 10px;
margin: 0;
border-radius: 999px;
background: #cbd5e1;
-webkit-appearance: none;
appearance: none;
cursor: pointer;
transition: width 0.3s ease, background 0.3s ease;
}
.carousel-dots input:hover {
background: #94a3b8;
}
.carousel-dots input:checked {
width: 28px;
background: #0f172a;
}
.carousel-dots input:focus-visible {
outline: 2px solid #0ea5e9;
outline-offset: 2px;
}
```
### Notes
- This CSS Carousel Dots is 33 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, Flexbox, the :checked state (no JavaScript) and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Off-canvas Menu
> A slide-in drawer menu with no JavaScript, built on so it is keyboard and screen reader friendly.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: drawer, sidebar, off-canvas, details, mobile menu, slide
- Live preview: https://copy-css.com/snippets/offcanvas-menu
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.offcanvas summary {
position: relative;
z-index: 2;
display: grid;
place-items: center;
width: 44px;
height: 44px;
border-radius: 12px;
background: #0f172a;
color: #fff;
list-style: none;
cursor: pointer;
}
.offcanvas summary::-webkit-details-marker {
display: none;
}
/* Hamburger: three lines that fold into an X when open */
.offcanvas summary::before,
.offcanvas summary::after {
content: "";
grid-area: 1 / 1;
width: 18px;
height: 2px;
border-radius: 2px;
background: currentColor;
transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.offcanvas summary::before {
box-shadow: 0 -6px currentColor, 0 6px currentColor;
}
.offcanvas[open] summary::before {
box-shadow: 0 0 transparent, 0 0 transparent;
transform: rotate(45deg);
}
.offcanvas[open] summary::after {
transform: rotate(-45deg);
}
.offcanvas summary:focus-visible {
outline: 2px solid #38bdf8;
outline-offset: 2px;
}
.offcanvas nav {
position: fixed;
inset: 0 auto 0 0;
z-index: 1;
display: grid;
align-content: start;
gap: 4px;
width: min(260px, 80vw);
padding: 72px 12px 12px;
background: #fff;
box-shadow: 8px 0 32px -12px rgba(0, 0, 0, 0.35);
animation: offcanvas-in 0.3s cubic-bezier(0.3, 0.7, 0.4, 1);
}
.offcanvas nav a {
padding: 10px 12px;
border-radius: 8px;
color: #334155;
font: 500 15px system-ui, sans-serif;
text-decoration: none;
}
.offcanvas nav a:hover {
background: #f1f5f9;
color: #0f172a;
}
@keyframes offcanvas-in {
from { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
.offcanvas nav {
animation: none;
}
}
```
### Notes
- This CSS Off-canvas Menu is 84 lines of pure CSS (1.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, transitions, transforms and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## 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
Skip to content
```
### CSS
```css
/* Put it first inside , 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.
## Responsive Navbar
> A header nav that collapses into a hamburger menu on narrow widths, using a checkbox and a container query.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: hamburger, mobile menu, header, checkbox, container query
- Live preview: https://copy-css.com/snippets/responsive-navbar
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.click-menu {
position: relative;
display: inline-block;
font: 500 14px system-ui, sans-serif;
}
.click-menu summary {
display: flex;
align-items: center;
gap: 10px;
padding: 9px 14px;
border: 1px solid #e2e8f0;
border-radius: 10px;
background: #ffffff;
color: #0f172a;
list-style: none;
cursor: pointer;
}
.click-menu summary::-webkit-details-marker {
display: none;
}
.click-menu summary::after {
content: "";
width: 6px;
height: 6px;
margin-top: -3px;
border: solid #64748b;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
transition: transform 0.2s ease;
}
.click-menu[open] summary::after {
margin-top: 3px;
transform: rotate(-135deg);
}
.click-menu summary:focus-visible {
outline: 2px solid #2563eb;
outline-offset: 2px;
}
.click-menu-list {
position: absolute;
top: calc(100% + 6px);
left: 0;
z-index: 10;
display: grid;
min-width: 160px;
padding: 6px;
border-radius: 12px;
background: #ffffff;
box-shadow: 0 0 0 1px #0f172a14, 0 12px 28px -8px #0f172a40;
transform-origin: top left;
animation: click-menu-in 0.15s ease-out;
}
.click-menu-list a {
padding: 8px 10px;
border-radius: 8px;
color: #334155;
text-decoration: none;
}
.click-menu-list a:hover {
background: #f1f5f9;
color: #0f172a;
}
.click-menu-list a:focus-visible {
outline: 2px solid #2563eb;
outline-offset: -2px;
}
.click-menu-list .click-menu-danger {
margin-top: 4px;
border-top: 1px solid #f1f5f9;
border-radius: 0 0 8px 8px;
color: #dc2626;
}
@keyframes click-menu-in {
from {
opacity: 0;
transform: scale(0.96) translateY(-4px);
}
}
@media (prefers-reduced-motion: reduce) {
.click-menu-list { animation: none; }
}
```
### Notes
- This CSS Click Dropdown Menu is 93 lines of pure CSS (1.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transitions, transforms and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Mega Menu
> A wide multi-column dropdown panel under a nav item, opened on hover or keyboard focus.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: dropdown, multi-column, header, hover, focus-within, ecommerce
- Live preview: https://copy-css.com/snippets/mega-menu
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.mega-menu {
display: flex;
align-items: center;
gap: 4px;
font: 500 14px system-ui, sans-serif;
}
.mega-menu-item {
position: relative;
}
.mega-menu > a,
.mega-menu-trigger {
display: block;
padding: 9px 12px;
border: 0;
border-radius: 8px;
background: none;
color: #334155;
font: inherit;
text-decoration: none;
cursor: pointer;
}
.mega-menu > a:hover,
.mega-menu-trigger:hover,
.mega-menu-item:focus-within .mega-menu-trigger {
background: #e2e8f0;
color: #0f172a;
}
.mega-menu-panel {
position: absolute;
top: 100%;
left: 0;
z-index: 10;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 4px 16px;
width: min(360px, calc(100vw - 32px));
margin-top: 8px;
padding: 16px;
border-radius: 14px;
background: #ffffff;
box-shadow: 0 0 0 1px #0f172a14, 0 18px 40px -12px #0f172a40;
opacity: 0;
visibility: hidden;
transform: translateY(-6px);
transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
/* Invisible bridge across the gap so hover is not lost */
.mega-menu-panel::before {
content: "";
position: absolute;
top: -10px;
right: 0;
left: 0;
height: 10px;
}
.mega-menu-item:hover .mega-menu-panel,
.mega-menu-item:focus-within .mega-menu-panel {
opacity: 1;
visibility: visible;
transform: none;
}
.mega-menu-heading {
margin: 0 8px 6px;
color: #64748b;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.mega-menu-panel a {
display: block;
padding: 7px 8px;
border-radius: 8px;
color: #0f172a;
text-decoration: none;
}
.mega-menu-panel a:hover {
background: #f1f5f9;
}
.mega-menu-panel .mega-menu-promo {
grid-column: 1 / -1;
margin-top: 8px;
padding: 10px 12px;
background: #eef2ff;
color: #4338ca;
font-weight: 600;
}
.mega-menu a:focus-visible,
.mega-menu-trigger:focus-visible {
outline: 2px solid #4f46e5;
outline-offset: 1px;
}
@media (prefers-reduced-motion: reduce) {
.mega-menu-panel { transition: none; }
}
```
### Notes
- This CSS Mega Menu is 107 lines of pure CSS (2.0 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Multi-level Dropdown
> A nested dropdown where submenus fly out to the side on hover or focus, built from plain nested lists.
- Category: [CSS Navigation](https://copy-css.com/category/navigation)
- Tags: dropdown, submenu, flyout, nested, focus-within, hover
- Live preview: https://copy-css.com/snippets/multilevel-dropdown
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.multi-menu ul {
margin: 0;
padding: 0;
list-style: none;
}
.multi-menu li {
position: relative;
}
.multi-menu a {
display: flex;
justify-content: space-between;
gap: 16px;
padding: 9px 12px;
border-radius: 8px;
color: #0f172a;
font: 500 14px system-ui, sans-serif;
text-decoration: none;
white-space: nowrap;
}
/* Arrow on items that have a submenu */
.multi-menu li:has(> ul) > a::after {
content: "›";
color: #94a3b8;
}
.multi-menu > ul > li > a::after {
transform: rotate(90deg);
}
.multi-menu li ul {
position: absolute;
top: 100%;
left: 0;
z-index: 10;
min-width: 150px;
padding: 6px;
border-radius: 12px;
background: #ffffff;
box-shadow: 0 0 0 1px #0f172a14, 0 12px 28px -8px #0f172a40;
opacity: 0;
visibility: hidden;
transition: opacity 0.15s ease, visibility 0.15s;
}
/* Third level flies out to the right */
.multi-menu li li ul {
top: -6px;
left: 100%;
}
.multi-menu li:hover > ul,
.multi-menu li:focus-within > ul {
opacity: 1;
visibility: visible;
}
.multi-menu a:hover,
.multi-menu li:focus-within > a {
background: #f1f5f9;
}
.multi-menu a:focus-visible {
outline: 2px solid #0891b2;
outline-offset: -2px;
}
```
### Notes
- This CSS Multi-level Dropdown is 68 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and Flexbox.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
# CSS Layouts
Flexbox and Grid recipes: centering, responsive grids, sidebars, bento boxes and masonry.
## Perfect Centering
> Center anything horizontally and vertically with two lines of CSS Grid.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: center, grid, place-items, align, vertical
- Live preview: https://copy-css.com/snippets/perfect-center
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Centered
```
### CSS
```css
/* Centers its children horizontally and vertically */
.center {
display: grid;
place-items: center;
}
```
### Notes
- This CSS Perfect Centering is 5 lines of pure CSS (0.1 KB) with no JavaScript and no dependencies. It uses CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Responsive Auto Grid
> A grid that adds and removes columns on its own. No media queries needed.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: grid, responsive, auto-fit, minmax, cards
- Live preview: https://copy-css.com/snippets/responsive-auto-grid
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.auto-grid {
--min: 220px; /* smallest a column may get */
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min)), 1fr));
gap: 16px;
}
```
### Notes
- This CSS Responsive Auto Grid is 6 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses CSS Grid and custom properties.
- Customize with: `--min`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Sidebar Layout
> A sidebar that sits beside the content and stacks automatically when space runs out.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: sidebar, flexbox, responsive, wrap, intrinsic
- Live preview: https://copy-css.com/snippets/sidebar-layout
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Sidebar
Main content
```
### CSS
```css
.with-sidebar {
display: flex;
flex-wrap: wrap;
gap: 16px;
}
/* Sidebar: wants to be about 240px wide */
.with-sidebar > :first-child {
flex-basis: 240px;
flex-grow: 1;
}
/* Content: takes the rest, wraps below when narrower than 60% */
.with-sidebar > :last-child {
flex-basis: 0;
flex-grow: 999;
min-inline-size: 60%;
}
```
### Notes
- This CSS Sidebar Layout is 18 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Bento Grid
> A trendy bento box layout with a large hero tile and spanning cells.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: bento, grid, span, dashboard, features
- Live preview: https://copy-css.com/snippets/bento-grid
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.bento {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-auto-rows: 160px;
gap: 16px;
}
.bento > :nth-child(1) {
grid-column: span 2;
grid-row: span 2;
}
.bento > :nth-child(4) {
grid-column: span 2;
}
@media (max-width: 640px) {
.bento { grid-template-columns: repeat(2, 1fr); }
}
```
### Notes
- This CSS Bento Grid is 19 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Sticky Footer Layout
> Keeps the footer at the bottom of the screen even when the page is short.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: footer, sticky, grid, page, full height
- Live preview: https://copy-css.com/snippets/sticky-footer
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Header
Content
Footer
```
### CSS
```css
/* Header and footer size to content; the middle row fills the rest */
.page {
display: grid;
grid-template-rows: auto 1fr auto;
min-height: 100vh;
}
```
### Notes
- This CSS Sticky Footer Layout is 6 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Masonry Columns
> An image-board style masonry layout using CSS multi-column. Works everywhere.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: masonry, columns, waterfall, gallery, multi-column
- Live preview: https://copy-css.com/snippets/masonry-columns
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.masonry {
columns: 3 200px; /* up to 3 columns, each at least 200px */
column-gap: 16px;
}
.masonry > * {
margin-bottom: 16px;
break-inside: avoid;
}
```
### Notes
- This CSS Masonry Columns is 9 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Holy Grail Layout
> Header, footer, two sidebars and content with named grid areas. Stacks on small screens.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: grid, grid-template-areas, header, sidebar, page
- Live preview: https://copy-css.com/snippets/holy-grail-layout
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
HeaderContent
```
### CSS
```css
.holy-grail {
display: grid;
grid-template:
"header header header" auto
"nav main aside" 1fr
"footer footer footer" auto
/ 200px 1fr 200px;
gap: 16px;
min-height: 100vh;
}
.holy-grail header { grid-area: header; }
.holy-grail nav { grid-area: nav; }
.holy-grail main { grid-area: main; }
.holy-grail aside { grid-area: aside; }
.holy-grail footer { grid-area: footer; }
@media (max-width: 720px) {
.holy-grail {
grid-template:
"header" auto
"nav" auto
"main" 1fr
"aside" auto
"footer" auto
/ 1fr;
}
}
```
### Notes
- This CSS Holy Grail Layout is 28 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Scroll Snap Carousel
> A swipeable horizontal carousel that snaps each slide into place. No JavaScript.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: carousel, slider, scroll-snap, horizontal, swipe
- Live preview: https://copy-css.com/snippets/scroll-snap-carousel
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
1
2
3
4
5
```
### CSS
```css
.snap-row {
display: grid;
grid-auto-flow: column;
grid-auto-columns: 80%;
gap: 12px;
overflow-x: auto;
overscroll-behavior-x: contain;
scroll-snap-type: x mandatory;
scroll-padding-inline: 8px;
padding: 0 8px 8px;
}
.snap-row > * {
scroll-snap-align: start;
}
```
### Notes
- This CSS Scroll Snap Carousel is 15 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses CSS Grid and scroll snapping.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Aspect Ratio Box
> Locks any element to a 16:9 ratio, perfect for video embeds and image placeholders.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: aspect-ratio, video, responsive, embed, media
- Live preview: https://copy-css.com/snippets/aspect-ratio-box
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
16 : 9
```
### CSS
```css
.ratio-box {
aspect-ratio: 16 / 9;
width: 100%;
}
/* Make embedded media fill the box */
.ratio-box > iframe,
.ratio-box > img,
.ratio-box > video {
width: 100%;
height: 100%;
border: 0;
object-fit: cover;
}
```
### Notes
- This CSS Aspect Ratio Box is 14 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses aspect-ratio.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Full Bleed Layout
> Keeps article text in a readable column while letting chosen elements break out to full width.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: full bleed, article, grid, content width, breakout
- Live preview: https://copy-css.com/snippets/full-bleed-layout
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Readable text column.
Full-width banner
Back to the column.
```
### CSS
```css
.flow {
--content: 65ch;
display: grid;
grid-template-columns:
[full-start] minmax(16px, 1fr)
[content-start] min(var(--content), 100% - 32px) [content-end]
minmax(16px, 1fr) [full-end];
}
.flow > * {
grid-column: content;
}
.flow > .full-bleed {
grid-column: full;
}
```
### Notes
- This CSS Full Bleed Layout is 16 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses CSS Grid and custom properties.
- Customize with: `--content`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Split Screen
> Two equal halves side by side that stack vertically on narrow screens.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: split, two column, hero, login, flex
- Live preview: https://copy-css.com/snippets/split-screen
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Left
Right
```
### CSS
```css
.split {
display: flex;
flex-wrap: wrap;
min-height: 100vh;
}
/* Each half is at least 320px; below that they stack */
.split > * {
flex: 1 1 320px;
}
```
### Notes
- This CSS Split Screen is 10 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Subgrid Card Alignment
> Cards side by side whose titles, text and buttons line up across the row, thanks to subgrid.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: subgrid, grid, cards, align, equal height
- Live preview: https://copy-css.com/snippets/subgrid-cards
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.sub-cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 16px;
font-family: system-ui, sans-serif;
}
/* Each card spans 3 rows and shares them with its neighbours */
.sub-cards > * {
display: grid;
grid-row: span 3;
grid-template-rows: subgrid;
row-gap: 10px;
padding: 16px;
border: 1px solid #bbf7d0;
border-radius: 14px;
background: #fff;
}
.sub-cards h3 {
margin: 0;
color: #14532d;
font-size: 17px;
line-height: 1.25;
}
.sub-cards p {
margin: 0;
color: #4b5563;
font-size: 14px;
line-height: 1.45;
}
.sub-cards a {
align-self: end;
padding: 9px;
border-radius: 8px;
background: #16a34a;
color: #fff;
font-size: 14px;
font-weight: 600;
text-align: center;
text-decoration: none;
}
```
### Notes
- This CSS Subgrid Card Alignment is 44 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses subgrid and CSS Grid.
- subgrid: Chrome 117+, Safari 16+, Firefox 71+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Container Query Card
> A card that switches from stacked to side by side based on its container’s width, not the viewport.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: container queries, @container, responsive, card, component
- Live preview: https://copy-css.com/snippets/container-query-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Container queries
This card lays itself out by its own width.
```
### CSS
```css
.cq-wrap {
container-type: inline-size;
}
.cq-card {
display: grid;
gap: 10px;
padding: 10px;
border: 1px solid #e0e7ff;
border-radius: 14px;
background: #fff;
font-family: system-ui, sans-serif;
}
.cq-media {
min-height: 72px;
border-radius: 10px;
background: linear-gradient(135deg, #a5b4fc, #6366f1);
}
.cq-card h3 {
margin: 0 0 4px;
color: #1e1b4b;
font-size: 15px;
}
.cq-card p {
margin: 0;
color: #64748b;
font-size: 13px;
line-height: 1.4;
}
/* Side by side once the container is wide enough */
@container (min-width: 300px) {
.cq-card {
grid-template-columns: 96px 1fr;
align-items: center;
gap: 14px;
}
.cq-media {
aspect-ratio: 1;
}
}
```
### Notes
- This CSS Container Query Card is 45 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses linear gradients, CSS Grid, container queries and aspect-ratio.
- container queries: Chrome 105+, Safari 16+, Firefox 110+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Grid Stack Overlay
> Layer badges and captions over an image by placing everything in one grid cell. No absolute positioning.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: grid-area, overlay, stack, layer, no absolute, image
- Live preview: https://copy-css.com/snippets/grid-stack
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
NewGolden hour
```
### CSS
```css
.stack {
display: grid;
margin: 0;
}
/* Every child shares the same cell */
.stack > * {
grid-area: 1 / 1;
}
/* Use an here in real projects */
.stack-media {
min-height: 140px;
border-radius: 14px;
background: #d4d4d8;
object-fit: cover;
}
.stack-badge {
align-self: start;
justify-self: end;
margin: 10px;
padding: 4px 10px;
border-radius: 999px;
background: #18181b;
color: #fff;
font: 700 11px system-ui, sans-serif;
letter-spacing: 0.06em;
text-transform: uppercase;
}
.stack figcaption {
align-self: end;
justify-self: start;
margin: 10px;
padding: 6px 12px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.85);
-webkit-backdrop-filter: blur(6px);
backdrop-filter: blur(6px);
color: #18181b;
font: 600 13px system-ui, sans-serif;
}
```
### Notes
- This CSS Grid Stack Overlay is 43 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses backdrop filters and CSS Grid.
- backdrop filters: Includes the -webkit- prefix for older Safari.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Flex Switcher
> Items sit in a row until the container gets too narrow, then all stack at once. No media queries.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: switcher, flexbox, responsive, no media query, columns, stack
- Live preview: https://copy-css.com/snippets/flex-switcher
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
One
Two
Three
```
### CSS
```css
.switcher {
--threshold: 30rem; /* below this width, everything stacks */
display: flex;
flex-wrap: wrap;
gap: 16px;
}
/* Wide: negative basis, so they share a row.
Narrow: huge basis, so each takes a full row. */
.switcher > * {
flex-grow: 1;
flex-basis: calc((var(--threshold) - 100%) * 999);
}
```
### Notes
- This CSS Flex Switcher is 13 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses Flexbox and custom properties.
- Customize with: `--threshold`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Sticky Sidebar
> A sidebar that sticks while the content scrolls. Scroll inside the preview to see it.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: sticky, sidebar, position sticky, scroll, grid, toc
- Live preview: https://copy-css.com/snippets/sticky-sidebar
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Section 1Section 2Section 3Section 4
```
### CSS
```css
.sticky-layout {
display: grid;
grid-template-columns: 220px 1fr;
align-items: start; /* without this, the sidebar stretches and can't stick */
gap: 32px;
}
.sticky-layout aside {
position: sticky;
top: 16px;
}
```
### Notes
- This CSS Sticky Sidebar is 11 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses CSS Grid and sticky positioning.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Bento Grid Template Areas
> A bento layout drawn with named grid-template-areas, rearranged for phones by redrawing the map.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: bento, grid-template-areas, named areas, dashboard, responsive
- Live preview: https://copy-css.com/snippets/bento-template-areas
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Hero
Stats
Team
Quote
Call to action
```
### CSS
```css
.bento-areas {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 140px;
grid-template-areas:
"hero hero stats"
"hero hero team"
"quote cta cta";
gap: 16px;
}
.bento-areas-hero { grid-area: hero; }
.bento-areas-stats { grid-area: stats; }
.bento-areas-team { grid-area: team; }
.bento-areas-quote { grid-area: quote; }
.bento-areas-cta { grid-area: cta; }
/* Phones: same tiles, new map */
@media (max-width: 640px) {
.bento-areas {
grid-template-columns: 1fr 1fr;
grid-template-areas:
"hero hero"
"stats team"
"quote quote"
"cta cta";
}
}
```
### Notes
- This CSS Bento Grid Template Areas is 28 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Dense Bento Grid
> A bento grid of wide, tall and big tiles that backfills empty holes with grid-auto-flow: dense.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: bento, grid-auto-flow, dense, span, gallery, no gaps
- Live preview: https://copy-css.com/snippets/dense-bento-grid
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.bento-dense {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
grid-auto-rows: 120px;
grid-auto-flow: dense; /* later small tiles fill earlier holes */
gap: 12px;
}
.bento-dense-wide {
grid-column: span 2;
}
.bento-dense-tall {
grid-row: span 2;
}
.bento-dense-big {
grid-column: span 2;
grid-row: span 2;
}
```
### Notes
- This CSS Dense Bento Grid is 20 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Bento Feature Grid
> A landing page feature section in bento style: one dark hero tile, two stat tiles and a wide banner.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: bento, landing page, features, cards, saas
- Live preview: https://copy-css.com/snippets/bento-feature-grid
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Ship faster
Everything you need to launch, in one place.
99.99%
Uptime
40+
Integrations
Built for teams
Roles, comments and shared libraries.
```
### CSS
```css
.bento-features {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px;
font: 14px/1.4 system-ui, sans-serif;
}
.bento-features article {
padding: 20px;
border-radius: 18px;
background: #f4f4f5;
color: #18181b;
}
.bento-features h3 {
margin: 0 0 4px;
font-size: 22px;
}
.bento-features p {
margin: 0;
color: #52525b;
}
.bento-features .bento-features-main {
grid-column: span 2;
grid-row: span 2;
display: flex;
flex-direction: column;
justify-content: flex-end;
background: #18181b;
color: #fafafa;
}
.bento-features .bento-features-main p {
color: #a1a1aa;
}
.bento-features .bento-features-wide {
grid-column: 1 / -1;
background: #d9f99d;
}
@media (max-width: 560px) {
.bento-features {
grid-template-columns: 1fr 1fr;
}
.bento-features .bento-features-main {
grid-row: auto;
}
}
```
### Notes
- This CSS Bento Feature Grid is 52 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses CSS Grid and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Holy Grail Flexbox
> The holy grail layout with Flexbox: sidebars and content wrap onto their own rows without media queries.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: holy grail, flex-wrap, header, sidebar, no media query
- Live preview: https://copy-css.com/snippets/holy-grail-flexbox
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Header
Content
```
### CSS
```css
.hg-flex {
display: flex;
flex-direction: column;
gap: 16px;
min-height: 100vh;
}
.hg-flex-body {
display: flex;
flex: 1;
flex-wrap: wrap;
gap: 16px;
}
/* When the row is narrower than 160 + 480 + 160px, items wrap */
.hg-flex-body nav,
.hg-flex-body aside {
flex: 1 1 160px;
}
.hg-flex-body main {
flex: 4 1 480px;
}
```
### Notes
- This CSS Holy Grail Flexbox is 23 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Dashboard App Shell
> A full-height admin layout with a sidebar, a top bar and a main area that scrolls on its own.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: dashboard, admin, sidebar, top bar, independent scroll, grid
- Live preview: https://copy-css.com/snippets/dashboard-app-shell
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Top bar
```
### CSS
```css
.app-shell {
--side: 240px;
display: grid;
grid-template:
"side top" auto
"side main" 1fr
/ var(--side) 1fr;
height: 100vh;
height: 100dvh;
}
.app-shell-side {
grid-area: side;
overflow-y: auto;
}
.app-shell-top {
grid-area: top;
}
/* Only the main area scrolls; sidebar and top bar stay put */
.app-shell-main {
grid-area: main;
min-height: 0;
overflow-y: auto;
}
/* Small screens: drop the sidebar (open it from a menu button instead) */
@media (max-width: 720px) {
.app-shell {
grid-template:
"top" auto
"main" 1fr
/ 1fr;
}
.app-shell-side {
display: none;
}
}
```
### Notes
- This CSS Dashboard App Shell is 40 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses CSS Grid and custom properties.
- Customize with: `--side`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Docs Page Layout
> A three-column docs layout: sticky nav, a readable article column and an on-page TOC that hide in steps.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: documentation, three column, table of contents, sticky, readable width
- Live preview: https://copy-css.com/snippets/docs-layout
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Article
```
### CSS
```css
.docs-layout {
--nav: 220px;
--content: 72ch;
--toc: 200px;
display: grid;
grid-template-columns: var(--nav) minmax(0, var(--content)) var(--toc);
justify-content: center;
align-items: start;
gap: 32px;
}
.docs-layout-nav,
.docs-layout-toc {
position: sticky;
top: 24px;
}
/* Medium screens: drop the table of contents */
@media (max-width: 1100px) {
.docs-layout {
grid-template-columns: var(--nav) minmax(0, var(--content));
}
.docs-layout-toc {
display: none;
}
}
/* Phones: article only (show the nav from a menu button) */
@media (max-width: 760px) {
.docs-layout {
grid-template-columns: minmax(0, 1fr);
}
.docs-layout-nav {
display: none;
}
}
```
### Notes
- This CSS Docs Page Layout is 38 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses CSS Grid, sticky positioning and custom properties.
- Customize with: `--nav`, `--content`, `--toc`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Grid Row-Span Masonry
> Masonry built on CSS Grid with tiny rows and per-item row spans, so items keep left-to-right order.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: masonry, grid, row span, reading order, pinterest
- Live preview: https://copy-css.com/snippets/grid-row-span-masonry
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
/* Each item spans --rows rows of 8px: set it from the item's height */
.grid-masonry {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
grid-auto-rows: 8px;
column-gap: 16px;
}
.grid-masonry > * {
grid-row: span var(--rows, 20);
margin-bottom: 16px;
}
```
### Notes
- This CSS Grid Row-Span Masonry is 12 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses CSS Grid and custom properties.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Justified Gallery Rows
> A photo gallery where every row fills the width and photos keep their shape, like Flickr or Google Photos.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: masonry, photo gallery, flex-grow, aspect-ratio, flickr
- Live preview: https://copy-css.com/snippets/justified-gallery
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
/* --r is each photo's width / height ratio */
.justified {
--row-height: 180px;
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.justified > * {
flex: calc(var(--r) * 100) 1 calc(var(--r) * var(--row-height));
aspect-ratio: var(--r);
}
.justified img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
/* Keeps the last row from stretching */
.justified::after {
content: "";
flex-grow: 1000000;
}
```
### Notes
- This CSS Justified Gallery Rows is 25 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses Flexbox, aspect-ratio and custom properties.
- Customize with: `--row-height`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Flexbox Sticky Footer
> Keeps the footer at the bottom of short pages with a flex column and margin-top: auto on the footer.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: footer, margin-top auto, flex column, full height, page
- Live preview: https://copy-css.com/snippets/flexbox-sticky-footer
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
HeaderShort content
```
### CSS
```css
.flex-page {
display: flex;
flex-direction: column;
min-height: 100vh;
min-height: 100dvh;
}
/* Pushes the footer down, however many elements come before it */
.flex-page > footer {
margin-top: auto;
}
```
### Notes
- This CSS Flexbox Sticky Footer is 11 lines of pure CSS (0.2 KB) with no JavaScript and no dependencies. It uses Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Reveal Footer
> A footer that sits underneath the page and is uncovered as the content scrolls away, like lifting a curtain.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: footer, curtain, parallax, position sticky, z-index
- Live preview: https://copy-css.com/snippets/reveal-footer
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Keep scrolling
The footer is waiting underneath this page.
```
### CSS
```css
.reveal-page {
font: 15px/1.5 system-ui, sans-serif;
}
/* The page slides over the footer */
.reveal-page-main {
position: relative;
z-index: 1;
box-sizing: border-box;
min-height: 100vh;
padding: 24px;
border-radius: 0 0 24px 24px;
background: #ffffff;
color: #334155;
box-shadow: 0 16px 32px -16px #0f172a59;
}
.reveal-page-main h2 {
margin: 0 0 8px;
color: #0f172a;
}
/* Sticks to the bottom, behind the page, until the page scrolls past */
.reveal-page-footer {
position: sticky;
bottom: 0;
display: grid;
place-items: center;
min-height: 240px;
background: #0f172a;
color: #e2e8f0;
font-weight: 600;
}
```
### Notes
- This CSS Reveal Footer is 33 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses box shadows, CSS Grid and sticky positioning.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Sticky Action Bar
> A bottom bar with a price and a buy button that stays in view while the page scrolls, safe-area aware.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: sticky bottom, checkout, mobile, call to action, safe area
- Live preview: https://copy-css.com/snippets/sticky-action-bar
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Trail Runner
Light, grippy and made for long days on rough ground.
```
### CSS
```css
.action-page {
background: #ffffff;
color: #334155;
font: 15px/1.5 system-ui, sans-serif;
}
.action-page-content {
padding: 16px;
}
.action-page-content h3 {
margin: 0 0 6px;
color: #0f172a;
}
.action-page-content p {
margin: 0 0 10px;
}
/* Sticks to the bottom of the screen (or scroll box) */
.action-bar {
position: sticky;
bottom: 0;
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
border-top: 1px solid #e2e8f0;
background: #ffffffe6;
-webkit-backdrop-filter: blur(8px);
backdrop-filter: blur(8px);
}
.action-bar b {
color: #0f172a;
font-size: 18px;
}
.action-bar a {
padding: 10px 16px;
border-radius: 10px;
background: #16a34a;
color: #ffffff;
font-weight: 600;
text-decoration: none;
white-space: nowrap;
}
.action-bar a:hover {
background: #15803d;
}
.action-bar a:focus-visible {
outline: 2px solid #15803d;
outline-offset: 2px;
}
```
### Notes
- This CSS Sticky Action Bar is 57 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses backdrop filters, Flexbox, sticky positioning and keyboard focus styles.
- backdrop filters: Includes the -webkit- prefix for older Safari.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Split Screen Login
> A sign-in page split into a brand panel and a centered form, with the panel turning into a banner on phones.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: split screen, sign in, auth page, two column, responsive
- Live preview: https://copy-css.com/snippets/split-login-layout
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.split-login {
display: grid;
grid-template-columns: 1fr 1fr;
min-height: 100vh;
min-height: 100dvh;
background: #ffffff;
}
.split-login-art {
background:
radial-gradient(circle at 30% 30%, #f472b6, #f472b600 60%),
linear-gradient(135deg, #4f46e5, #7c3aed);
}
.split-login-form {
display: grid;
align-content: center;
gap: 14px;
box-sizing: border-box;
width: min(100%, 340px);
margin: 0 auto;
padding: 32px 24px;
color: #0f172a;
font: 15px/1.4 system-ui, sans-serif;
}
.split-login-form h2 {
margin: 0;
font-size: 26px;
}
.split-login-form label {
display: grid;
gap: 6px;
color: #475569;
font-weight: 600;
}
.split-login-form input {
padding: 11px 12px;
border: 1px solid #cbd5e1;
border-radius: 10px;
font: inherit;
}
.split-login-form button {
padding: 11px 12px;
border: 0;
border-radius: 10px;
background: #4f46e5;
color: #ffffff;
font: 600 15px system-ui, sans-serif;
cursor: pointer;
}
.split-login-form input:focus-visible,
.split-login-form button:focus-visible {
outline: 2px solid #4f46e5;
outline-offset: 2px;
}
/* Phones: the art becomes a short banner on top */
@media (max-width: 720px) {
.split-login {
grid-template-columns: 1fr;
grid-template-rows: 140px 1fr;
}
}
```
### Notes
- This CSS Split Screen Login is 68 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses linear gradients, radial gradients, CSS Grid and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Half-Bleed Split
> Text stays aligned to the page container while the image half runs all the way to the edge of the screen.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: split screen, full bleed, container, image edge, hero
- Live preview: https://copy-css.com/snippets/half-bleed-split
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Made for makers
Text keeps to the page grid. The image runs to the edge.
```
### CSS
```css
.half-bleed {
--content: 1100px;
--gutter: 24px;
display: grid;
grid-template-columns:
minmax(var(--gutter), 1fr)
minmax(0, calc(var(--content) / 2))
minmax(0, calc(var(--content) / 2))
minmax(var(--gutter), 1fr);
align-items: center;
font: 16px/1.5 system-ui, sans-serif;
}
.half-bleed-text {
grid-column: 2;
padding-right: 10%;
color: #44403c;
}
.half-bleed-text h2 {
margin: 0 0 8px;
color: #1c1917;
font-size: 32px;
line-height: 1.1;
}
.half-bleed-text p {
margin: 0;
}
/* From the middle of the container to the right edge of the screen */
.half-bleed-media {
grid-column: 3 / -1;
align-self: stretch;
min-height: 360px;
}
.half-bleed-media img {
width: 100%;
height: 100%;
object-fit: cover;
}
@media (max-width: 720px) {
.half-bleed {
grid-template-columns: var(--gutter) 1fr var(--gutter);
row-gap: 24px;
}
.half-bleed-text {
padding: 0;
}
.half-bleed-media {
grid-column: 1 / -1;
min-height: 240px;
}
}
```
### Notes
- This CSS Half-Bleed Split is 58 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses CSS Grid and custom properties.
- Customize with: `--content`, `--gutter`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Diagonal Split Screen
> A two-sided hero cut by a diagonal line with clip-path, each side holding its own message and link.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: split screen, clip-path, diagonal, hero, two audiences
- Live preview: https://copy-css.com/snippets/diagonal-split
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.diag-split {
display: grid;
min-height: 60vh;
font: 15px/1.3 system-ui, sans-serif;
}
/* Both halves share one grid cell; the second is cut diagonally */
.diag-split > * {
grid-area: 1 / 1;
display: flex;
flex-direction: column;
justify-content: center;
gap: 10px;
padding: 40px;
}
.diag-split h2 {
margin: 0;
font-size: 28px;
}
.diag-split a {
color: inherit;
font-weight: 700;
}
.diag-split a:focus-visible {
outline: 2px solid currentColor;
outline-offset: 3px;
}
.diag-split-a {
align-items: flex-start;
padding-right: 55%;
background: #fef3c7;
color: #78350f;
}
.diag-split-b {
align-items: flex-end;
padding-left: 55%;
background: #1e1b4b;
color: #e0e7ff;
text-align: right;
clip-path: polygon(58% 0, 100% 0, 100% 100%, 42% 100%);
}
/* Phones: stack, with a slanted top edge on the second half */
@media (max-width: 560px) {
.diag-split > * {
grid-area: auto;
padding: 32px 24px;
}
.diag-split-b {
margin-top: -24px;
clip-path: polygon(0 24px, 100% 0, 100% 100%, 0 100%);
}
}
```
### Notes
- This CSS Diagonal Split Screen is 59 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses clip paths, CSS Grid, Flexbox and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Zigzag Feature Rows
> Feature rows that alternate image and text sides down the page, then stack in order on phones.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: alternating, image text, landing page, nth-child, order
- Live preview: https://copy-css.com/snippets/zigzag-features
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Plan
Map the work in minutes.
Build
Ship it with your team.
Launch
Go live with one click.
```
### CSS
```css
.feature-zigzag {
display: grid;
gap: 56px;
font: 16px/1.5 system-ui, sans-serif;
}
.feature-zigzag-row {
display: grid;
grid-template-columns: 1fr 1fr;
align-items: center;
gap: 40px;
}
/* Every second row puts the image on the right */
.feature-zigzag-row:nth-child(even) .feature-zigzag-media {
order: 2;
}
.feature-zigzag-media {
aspect-ratio: 4 / 3;
border-radius: 16px;
background: linear-gradient(135deg, #a5b4fc, #6366f1);
}
.feature-zigzag-text h3 {
margin: 0 0 6px;
color: #0f172a;
font-size: 24px;
}
.feature-zigzag-text p {
margin: 0;
color: #475569;
}
@media (max-width: 640px) {
.feature-zigzag-row {
grid-template-columns: 1fr;
gap: 16px;
}
.feature-zigzag-row:nth-child(even) .feature-zigzag-media {
order: 0;
}
}
```
### Notes
- This CSS Zigzag Feature Rows is 45 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses linear gradients, CSS Grid and aspect-ratio.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Max Columns Grid
> A responsive auto-fill grid that wraps on small screens but never grows past a set number of columns.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: responsive grid, auto-fill, column limit, minmax, cards
- Live preview: https://copy-css.com/snippets/max-columns-grid
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.grid-max {
--cols: 3; /* never more than this */
--min: 200px; /* never narrower than this */
--gap: 16px;
display: grid;
grid-template-columns: repeat(
auto-fill,
minmax(min(100%, max(var(--min), (100% - (var(--cols) - 1) * var(--gap)) / var(--cols))), 1fr)
);
gap: var(--gap);
}
```
### Notes
- This CSS Max Columns Grid is 11 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses CSS Grid and custom properties.
- Customize with: `--cols`, `--min`, `--gap`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Centered Last Row Grid
> A wrapping grid of equal cards where an uneven last row is centered instead of hugging the left.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: flex-wrap, orphans, centered, responsive grid, logos, team
- Live preview: https://copy-css.com/snippets/centered-last-row
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
/* Flexbox, not Grid: only flex can center a short last row */
.grid-center {
--cols: 3;
--min: 180px;
--gap: 16px;
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: var(--gap);
}
.grid-center > * {
flex: 0 1 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
min-width: min(100%, var(--min));
}
```
### Notes
- This CSS Centered Last Row Grid is 15 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses Flexbox and custom properties.
- Customize with: `--cols`, `--min`, `--gap`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Twelve Column Grid
> A tiny mobile-first 12-column grid system: everything is full width until the span classes kick in.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: 12 column, grid system, span, bootstrap alternative, mobile first
- Live preview: https://copy-css.com/snippets/twelve-column-grid
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
12
6
6
4
4
4
8
4
```
### CSS
```css
.grid12 {
display: grid;
grid-template-columns: repeat(12, minmax(0, 1fr));
gap: 16px;
}
/* Mobile first: every item takes the full row */
.grid12 > * {
grid-column: span 12;
}
@media (min-width: 640px) {
.grid12 > .grid12-span-3 { grid-column: span 3; }
.grid12 > .grid12-span-4 { grid-column: span 4; }
.grid12 > .grid12-span-6 { grid-column: span 6; }
.grid12 > .grid12-span-8 { grid-column: span 8; }
.grid12 > .grid12-span-9 { grid-column: span 9; }
}
```
### Notes
- This CSS Twelve Column Grid is 18 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Container Query Grid
> A card grid that picks 1, 2, 3 or 4 columns from the width of its container, not the viewport.
- Category: [CSS Layouts](https://copy-css.com/category/layouts)
- Tags: @container, responsive grid, columns, component, breakpoints
- Live preview: https://copy-css.com/snippets/container-query-grid
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.cq-grid-wrap {
container-type: inline-size;
}
.cq-grid {
display: grid;
grid-template-columns: 1fr;
gap: 16px;
}
@container (min-width: 300px) {
.cq-grid { grid-template-columns: repeat(2, 1fr); }
}
@container (min-width: 500px) {
.cq-grid { grid-template-columns: repeat(3, 1fr); }
}
@container (min-width: 700px) {
.cq-grid { grid-template-columns: repeat(4, 1fr); }
}
```
### Notes
- This CSS Container Query Grid is 21 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses CSS Grid and container queries.
- container queries: Chrome 105+, Safari 16+, Firefox 110+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
# CSS Effects
Tooltips, morphing blobs, hamburger menus and other small delights.
## Pure CSS Tooltip
> A tooltip that reads its text from a data attribute and fades in on hover.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: tooltip, hover, attr, popover
- Live preview: https://copy-css.com/snippets/css-tooltip
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.tooltip {
position: relative;
padding: 10px 18px;
border: 1px solid #d1d5db;
border-radius: 8px;
background: #fff;
font: 500 15px system-ui, sans-serif;
cursor: pointer;
}
.tooltip::after {
content: attr(data-tip);
position: absolute;
bottom: calc(100% + 10px);
left: 50%;
padding: 6px 10px;
border-radius: 6px;
background: #111827;
color: #fff;
font-size: 13px;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transform: translate(-50%, 4px);
transition: opacity 0.2s ease, transform 0.2s ease;
}
.tooltip:hover::after,
.tooltip:focus-visible::after {
opacity: 1;
transform: translate(-50%, 0);
}
```
### Notes
- This CSS Tooltip is 32 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, transforms and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Morphing Blob
> An organic gradient blob that slowly morphs shape using border-radius.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: blob, morph, border-radius, organic, animation
- Live preview: https://copy-css.com/snippets/morphing-blob
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.blob {
width: 150px;
height: 150px;
background: linear-gradient(135deg, #f472b6, #8b5cf6);
border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
animation: morph 8s ease-in-out infinite;
}
@keyframes morph {
50% { border-radius: 70% 30% 46% 54% / 30% 39% 61% 70%; }
}
@media (prefers-reduced-motion: reduce) {
.blob {
animation: none;
}
}
```
### Notes
- This CSS Morphing Blob is 17 lines of pure CSS (0.3 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Hamburger to X
> A pure CSS hamburger menu icon that animates into an X when clicked, using a hidden checkbox.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: hamburger, menu, icon, navigation, toggle
- Live preview: https://copy-css.com/snippets/hamburger-menu
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.burger {
position: relative;
display: inline-block;
width: 44px;
height: 44px;
border-radius: 8px;
cursor: pointer;
}
.burger-toggle {
position: absolute;
opacity: 0;
pointer-events: none;
}
.burger:has(.burger-toggle:focus-visible) {
outline: 2px solid #2563eb;
outline-offset: 2px;
}
.burger-line,
.burger-line::before,
.burger-line::after {
position: absolute;
width: 28px;
height: 3px;
border-radius: 3px;
background: #111;
transition: transform 0.3s ease, top 0.3s ease, background 0.3s ease;
}
.burger-line {
top: calc(50% - 1.5px);
left: 8px;
}
.burger-line::before,
.burger-line::after {
content: "";
left: 0;
}
.burger-line::before {
top: -9px;
}
.burger-line::after {
top: 9px;
}
.burger-toggle:checked + .burger-line {
background: transparent;
}
.burger-toggle:checked + .burger-line::before {
top: 0;
transform: rotate(45deg);
}
.burger-toggle:checked + .burger-line::after {
top: 0;
transform: rotate(-45deg);
}
@media (prefers-reduced-motion: reduce) {
.burger-line,
.burger-line::before,
.burger-line::after {
transition: none;
}
}
```
### Notes
- This CSS Hamburger to X is 71 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses transitions, transforms, the :has() selector and the :checked state (no JavaScript).
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Avatar Stack
> Overlapping avatar circles that pop up on hover, with a "+N" counter.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: avatar, stack, overlap, users, team
- Live preview: https://copy-css.com/snippets/avatar-stack
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
AKJMRS+5
```
### CSS
```css
.avatars {
display: flex;
}
.avatars span {
position: relative;
display: grid;
place-items: center;
width: 44px;
height: 44px;
margin-left: -12px;
border: 3px solid #fff;
border-radius: 50%;
color: #fff;
font: 700 14px system-ui, sans-serif;
transition: transform 0.2s ease;
}
.avatars span:first-child {
margin-left: 0;
}
.avatars span:hover {
z-index: 1;
transform: translateY(-4px);
}
.avatars .more {
background: #111;
}
```
### Notes
- This CSS Avatar Stack is 30 lines of pure CSS (0.4 KB) with no JavaScript and no dependencies. It uses transitions, transforms, CSS Grid and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Live Badge
> A "Live" status pill with a pulsing dot, made with a single element.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: badge, live, pill, pulse, status
- Live preview: https://copy-css.com/snippets/live-badge
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Live
```
### CSS
```css
.badge-live {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 7px 14px 7px 12px;
border-radius: 999px;
background: #fef2f2;
color: #dc2626;
font: 700 13px/1 system-ui, sans-serif;
letter-spacing: 0.06em;
text-transform: uppercase;
}
.badge-live::before {
content: "";
width: 8px;
height: 8px;
border-radius: 50%;
background: currentColor;
animation: live-pulse 1.4s ease-out infinite;
}
@keyframes live-pulse {
0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); }
100% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}
@media (prefers-reduced-motion: reduce) {
.badge-live::before {
animation: none;
}
}
```
### Notes
- This CSS Live Badge is 32 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses keyframe animations, box shadows, Flexbox and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Notification Badge
> A bell icon button with an unread-count badge that rings on hover.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: badge, bell, notification, count, icon
- Live preview: https://copy-css.com/snippets/notification-badge
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.notify-bell {
position: relative;
display: grid;
place-items: center;
width: 48px;
height: 48px;
border: 1px solid #e5e7eb;
border-radius: 14px;
background: #fff;
cursor: pointer;
}
.notify-bell svg {
width: 22px;
height: 22px;
fill: none;
stroke: #111;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
transform-origin: top center;
}
.notify-bell:hover svg {
animation: notify-bell-ring 0.6s ease;
}
.notify-bell-count {
position: absolute;
top: -6px;
right: -6px;
box-sizing: border-box;
min-width: 20px;
height: 20px;
padding: 0 5px;
border: 2px solid #fff;
border-radius: 999px;
background: #ef4444;
color: #fff;
font: 700 11px/16px system-ui, sans-serif;
text-align: center;
}
@keyframes notify-bell-ring {
20% { transform: rotate(14deg); }
40% { transform: rotate(-12deg); }
60% { transform: rotate(8deg); }
80% { transform: rotate(-4deg); }
}
@media (prefers-reduced-motion: reduce) {
.notify-bell:hover svg {
animation: none;
}
}
```
### Notes
- This CSS Notification Badge is 55 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, CSS Grid and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Infinite Marquee
> A seamless, endlessly scrolling row with faded edges. Great for logo strips.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: marquee, scroll, ticker, logos, loop, animation
- Live preview: https://copy-css.com/snippets/infinite-marquee
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
HTMLCSSDesignMotionHTMLCSSDesignMotion
```
### CSS
```css
/* The track holds the items twice so the loop is seamless */
.marquee {
width: 260px;
overflow: hidden;
-webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.marquee-track {
display: flex;
gap: 12px;
width: max-content;
animation: marquee-scroll 10s linear infinite;
}
.marquee-track span {
padding: 8px 16px;
border-radius: 999px;
background: #111;
color: #fff;
font: 600 14px system-ui, sans-serif;
}
.marquee:hover .marquee-track {
animation-play-state: paused;
}
@keyframes marquee-scroll {
to { transform: translateX(calc(-50% - 6px)); }
}
@media (prefers-reduced-motion: reduce) {
.marquee-track {
animation: none;
}
}
```
### Notes
- This CSS Infinite Marquee is 36 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, linear gradients and masks.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Story Ring Avatar
> An avatar wrapped in a colorful gradient ring, like social media stories.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: avatar, story, ring, conic-gradient, social
- Live preview: https://copy-css.com/snippets/story-ring-avatar
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
AK
```
### CSS
```css
.story {
display: grid;
place-items: center;
width: 76px;
height: 76px;
padding: 3px;
box-sizing: border-box;
border-radius: 50%;
background: conic-gradient(#f59e0b, #ef4444, #d946ef, #f59e0b);
cursor: pointer;
transition: transform 0.2s ease;
}
.story:hover {
transform: scale(1.06);
}
.story span {
display: grid;
place-items: center;
width: 100%;
height: 100%;
box-sizing: border-box;
border: 3px solid #fff;
border-radius: 50%;
background: #e0e7ff;
color: #4338ca;
font: 700 22px system-ui, sans-serif;
}
```
### Notes
- This CSS Story Ring Avatar is 29 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions, transforms, conic gradients and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Animated Checkmark
> A success checkmark that draws itself with an SVG stroke animation.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: checkmark, success, svg, stroke, draw, animation
- Live preview: https://copy-css.com/snippets/animated-checkmark
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
/* Remove "infinite" from both animations to play it once */
.checkmark {
width: 72px;
height: 72px;
fill: none;
stroke: #22c55e;
stroke-width: 3;
stroke-linecap: round;
stroke-linejoin: round;
}
.checkmark circle {
stroke-dasharray: 151;
animation: check-circle 3s ease infinite;
}
.checkmark path {
stroke-dasharray: 32;
animation: check-tick 3s ease infinite;
}
@keyframes check-circle {
0% { stroke-dashoffset: 151; }
25%, 100% { stroke-dashoffset: 0; }
}
@keyframes check-tick {
0%, 20% { stroke-dashoffset: 32; }
35%, 100% { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
.checkmark circle,
.checkmark path {
animation: none;
}
}
```
### Notes
- This CSS Animated Checkmark is 37 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Corner Ribbon
> A diagonal "NEW" ribbon across the corner of a card.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: ribbon, badge, corner, new, label
- Live preview: https://copy-css.com/snippets/corner-ribbon
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
New
```
### CSS
```css
.ribbon-box {
position: relative;
overflow: hidden;
width: 180px;
height: 120px;
border-radius: 12px;
background: #fff;
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.ribbon {
position: absolute;
top: 18px;
right: -34px;
width: 120px;
padding: 6px 0;
background: #ef4444;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
color: #fff;
font: 800 12px/1 system-ui, sans-serif;
letter-spacing: 0.1em;
text-align: center;
text-transform: uppercase;
transform: rotate(45deg);
}
```
### Notes
- This CSS Corner Ribbon is 25 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transforms and box shadows.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Accordion
> An accessible FAQ accordion built on native details and summary, with a rotating plus icon.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: accordion, details, summary, faq, disclosure
- Live preview: https://copy-css.com/snippets/css-accordion
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Is it free?
Yes, use it anywhere.
Does it need JavaScript?
No, it is native HTML.
```
### CSS
```css
.accordion {
width: 260px;
border: 1px solid #e2e8f0;
border-radius: 12px;
background: #fff;
font: 14px/1.4 system-ui, sans-serif;
}
.accordion details + details {
border-top: 1px solid #e2e8f0;
}
.accordion summary {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 16px;
color: #0f172a;
font-weight: 600;
list-style: none;
cursor: pointer;
}
.accordion summary::-webkit-details-marker {
display: none;
}
.accordion summary::after {
content: "+";
color: #64748b;
font-size: 20px;
line-height: 1;
transition: transform 0.2s ease;
}
.accordion details[open] summary::after {
transform: rotate(45deg);
}
.accordion p {
margin: 0;
padding: 0 16px 14px;
color: #475569;
}
```
### Notes
- This CSS Accordion is 44 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, transforms and Flexbox.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## 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
Press Ctrl + K to search
```
### 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.
## Zoom on Hover
> Smoothly zooms an image inside its frame on hover without changing the layout.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: image, zoom, hover, scale, gallery
- Live preview: https://copy-css.com/snippets/zoom-on-hover
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.zoom-frame {
overflow: hidden;
border-radius: 14px;
}
.zoom-frame img {
display: block;
width: 100%;
height: auto;
transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.zoom-frame:hover img {
transform: scale(1.08);
}
```
### Notes
- This CSS Zoom on Hover is 15 lines of pure CSS (0.2 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.
## Toast Notification
> A compact success toast that slides up and fades in when it appears.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: toast, notification, snackbar, slide, alert
- Live preview: https://copy-css.com/snippets/toast-slide-in
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
✓
Changes saved
```
### CSS
```css
.toast-ok {
display: inline-flex;
align-items: center;
gap: 10px;
padding: 12px 18px 12px 12px;
border-radius: 12px;
background: #18181b;
box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.5);
color: #fafafa;
font: 500 14px/1 system-ui, sans-serif;
animation: toast-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.toast-ok span {
display: grid;
place-items: center;
width: 22px;
height: 22px;
border-radius: 50%;
background: #22c55e;
color: #052e16;
font-weight: 800;
}
@keyframes toast-in {
from { opacity: 0; transform: translateY(16px) scale(0.96); }
}
@media (prefers-reduced-motion: reduce) {
.toast-ok { animation: none; }
}
```
### Notes
- This CSS Toast Notification is 31 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Scroll Down Indicator
> The little mouse with a scrolling wheel that tells visitors there is more below the hero.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: scroll, mouse, hero, indicator, hint, animation
- Live preview: https://copy-css.com/snippets/scroll-down-indicator
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.scroll-hint {
position: relative;
display: block;
width: 26px;
height: 42px;
border: 2px solid #e2e8f0;
border-radius: 14px;
}
/* The wheel */
.scroll-hint::before {
content: "";
position: absolute;
top: 8px;
left: 50%;
width: 4px;
height: 8px;
margin-left: -2px;
border-radius: 2px;
background: #e2e8f0;
animation: scroll-wheel 1.6s ease-in-out infinite;
}
.scroll-hint:focus-visible {
outline: 2px solid #38bdf8;
outline-offset: 4px;
}
@keyframes scroll-wheel {
0% { opacity: 0; transform: translateY(0); }
30% { opacity: 1; }
100% { opacity: 0; transform: translateY(14px); }
}
@media (prefers-reduced-motion: reduce) {
.scroll-hint::before { animation: none; }
}
```
### Notes
- This CSS Scroll Down Indicator is 37 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, keyboard focus styles and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Heart Like Button
> A heart that fills and pops with a burst ring when liked, built on a plain checkbox.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: like, heart, favorite, toggle, checkbox, pop
- Live preview: https://copy-css.com/snippets/heart-like-toggle
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.like {
position: relative;
display: inline-grid;
place-items: center;
width: 56px;
height: 56px;
border-radius: 50%;
cursor: pointer;
transition: background 0.2s ease;
}
.like:hover {
background: #ffe4e6;
}
.like input {
position: absolute;
inset: 0;
margin: 0;
opacity: 0;
cursor: pointer;
}
.like svg {
width: 30px;
height: 30px;
fill: transparent;
stroke: #71717a;
stroke-width: 2;
stroke-linejoin: round;
pointer-events: none;
transition: fill 0.2s ease, stroke 0.2s ease;
}
.like:hover svg {
stroke: #f43f5e;
}
.like input:checked + svg {
fill: #f43f5e;
stroke: #f43f5e;
animation: like-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}
/* Burst ring */
.like::after {
content: "";
position: absolute;
inset: 6px;
border: 2px solid #f43f5e;
border-radius: 50%;
opacity: 0;
pointer-events: none;
}
.like:has(input:checked)::after {
animation: like-burst 0.5s ease-out;
}
.like:has(input:focus-visible) {
outline: 2px solid #f43f5e;
outline-offset: 2px;
}
@keyframes like-pop {
from { transform: scale(0.6); }
}
@keyframes like-burst {
from { opacity: 1; transform: scale(0.5); }
to { opacity: 0; transform: scale(1.3); }
}
@media (prefers-reduced-motion: reduce) {
.like input:checked + svg,
.like:has(input:checked)::after { animation: none; }
}
```
### Notes
- This CSS Heart Like Button is 77 lines of pure CSS (1.3 KB) with no JavaScript and no dependencies. It uses keyframe animations, transitions, transforms and CSS Grid.
- the :has() selector: Chrome 105+, Safari 15.4+, Firefox 121+.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Ringing Bell
> A notification bell that swings now and then to draw the eye, with an unread count badge.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: bell, notification, ring, shake, icon, alert
- Live preview: https://copy-css.com/snippets/bell-ring
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.ringing-bell {
position: relative;
display: grid;
place-items: center;
width: 52px;
height: 52px;
border: 0;
border-radius: 14px;
background: #fff;
box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.3);
cursor: pointer;
}
.ringing-bell svg {
width: 26px;
height: 26px;
fill: none;
stroke: #0f172a;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
transform-origin: 50% 10%;
animation: ringing-bell-swing 2.4s ease-in-out infinite;
}
.ringing-bell span {
position: absolute;
top: 6px;
right: 6px;
box-sizing: border-box;
min-width: 18px;
height: 18px;
padding: 0 5px;
border-radius: 999px;
background: #ef4444;
box-shadow: 0 0 0 2px #fff;
color: #fff;
font: 700 11px/18px system-ui, sans-serif;
}
.ringing-bell:focus-visible {
outline: 2px solid #6366f1;
outline-offset: 2px;
}
@keyframes ringing-bell-swing {
0%, 35%, 100% { transform: rotate(0); }
5% { transform: rotate(18deg); }
10% { transform: rotate(-16deg); }
15% { transform: rotate(12deg); }
20% { transform: rotate(-8deg); }
25% { transform: rotate(4deg); }
}
@media (prefers-reduced-motion: reduce) {
.ringing-bell svg { animation: none; }
}
```
### Notes
- This CSS Ringing Bell is 57 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Waving Hand
> The friendly waving-hand greeting from portfolio heroes, pivoting from the wrist.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: wave, emoji, hello, greeting, hero, animation
- Live preview: https://copy-css.com/snippets/waving-hand
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
👋 Hi there!
```
### CSS
```css
.hello {
margin: 0;
color: #18181b;
font: 700 28px system-ui, sans-serif;
}
.wave {
display: inline-block;
transform-origin: 70% 70%; /* the wrist */
animation: wave 2.5s ease-in-out infinite;
}
@keyframes wave {
0%, 60%, 100% { transform: rotate(0); }
10% { transform: rotate(14deg); }
20% { transform: rotate(-8deg); }
30% { transform: rotate(14deg); }
40% { transform: rotate(-4deg); }
50% { transform: rotate(10deg); }
}
@media (prefers-reduced-motion: reduce) {
.wave { animation: none; }
}
```
### Notes
- This CSS Waving Hand is 24 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Sibling Dim Hover
> Hovering or focusing one link fades and blurs its siblings, using :has() on the list so it needs no JavaScript.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: hover, has, dim, focus, menu, blur siblings
- Live preview: https://copy-css.com/snippets/sibling-dim-hover
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.spring-icons {
display: flex;
gap: 14px;
margin: 0;
padding: 0;
list-style: none;
}
.spring-icons a {
display: grid;
place-items: center;
width: 60px;
height: 60px;
border-radius: 18px;
background: #fff;
box-shadow: 0 6px 16px -8px rgba(30, 64, 175, 0.4);
font-size: 28px;
text-decoration: none;
transition: transform 0.25s ease;
transition: transform 0.7s linear(0, 0.45 7%, 0.96 15%, 1.17 22%, 1.21 28%, 1.13 37%, 0.98 50%, 0.95 58%, 1 72%, 1.01 85%, 1);
}
.spring-icons a:hover,
.spring-icons a:focus-visible {
transform: scale(1.25);
}
.spring-icons a:focus-visible {
outline: 2px solid #2563eb;
outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
.spring-icons a {
transition: none;
}
}
```
### Notes
- This CSS Spring Hover Scale is 37 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Frosted Modal Backdrop
> A tinted, blurred overlay behind a modal, with the same look applied to a native dialog::backdrop.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: modal, dialog, backdrop, blur, overlay, glassmorphism
- Live preview: https://copy-css.com/snippets/frosted-modal-backdrop
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Discard changes?
Your edits will be lost.
```
### CSS
```css
.frost-scrim,
dialog.frost-modal::backdrop {
background: rgba(15, 23, 42, 0.3);
-webkit-backdrop-filter: blur(6px);
backdrop-filter: blur(6px);
}
.frost-scrim {
position: fixed;
inset: 0;
z-index: 50;
display: grid;
place-items: center;
padding: 16px;
}
.frost-modal {
width: min(100%, 240px);
padding: 20px;
border: 0;
border-radius: 16px;
background: #fff;
box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.45);
color: #0f172a;
font-family: system-ui, sans-serif;
}
.frost-modal h3 {
margin: 0 0 4px;
font-size: 17px;
}
.frost-modal p {
margin: 0 0 16px;
color: #64748b;
font-size: 14px;
}
.frost-modal button {
width: 100%;
padding: 10px;
border: 0;
border-radius: 10px;
background: #0f172a;
color: #fff;
font: 600 14px system-ui, sans-serif;
cursor: pointer;
}
.frost-modal button:focus-visible {
outline: 2px solid #0f172a;
outline-offset: 2px;
}
```
### Notes
- This CSS Frosted Modal Backdrop is 53 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses box shadows, backdrop filters, CSS Grid and keyboard focus styles.
- backdrop filters: Includes the -webkit- prefix for older Safari.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Liquid Glass Effect
> An Apple-style liquid glass toolbar with light blur, boosted color and bright specular rims made from inset shadows.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: liquid glass, glassmorphism, apple, specular, toolbar, backdrop-filter
- Live preview: https://copy-css.com/snippets/liquid-glass
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.liquid-glass {
display: flex;
gap: 6px;
padding: 8px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.08);
-webkit-backdrop-filter: blur(3px) saturate(180%) brightness(1.08);
backdrop-filter: blur(3px) saturate(180%) brightness(1.08);
box-shadow:
inset 1.5px 1.5px 0 rgba(255, 255, 255, 0.75),
inset -1px -1px 0 rgba(255, 255, 255, 0.35),
inset 0 0 18px rgba(255, 255, 255, 0.25),
0 10px 30px rgba(0, 0, 0, 0.25);
}
.liquid-glass a {
display: grid;
place-items: center;
width: 46px;
height: 46px;
border-radius: 50%;
color: #fff;
transition: background 0.2s ease, transform 0.2s ease;
}
.liquid-glass a:hover {
background: rgba(255, 255, 255, 0.18);
transform: scale(1.06);
}
.liquid-glass a:focus-visible {
outline: 2px solid #fff;
outline-offset: 1px;
}
.liquid-glass svg {
width: 22px;
height: 22px;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
@media (prefers-reduced-motion: reduce) {
.liquid-glass a {
transition: none;
}
}
```
### Notes
- This CSS Liquid Glass Effect is 51 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and backdrop filters.
- backdrop filters: Includes the -webkit- prefix for older Safari.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Progressive Blur
> A blur that gets stronger toward the bottom edge, made from stacked backdrop-filter layers with gradient masks.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: progressive blur, gradient blur, backdrop-filter, mask, image caption, fade
- Live preview: https://copy-css.com/snippets/progressive-blur
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Golden hour · Lisbon
```
### CSS
```css
.pblur {
position: relative;
width: 240px;
height: 160px;
margin: 0;
overflow: hidden;
border-radius: 18px;
/* Replace with your photo: url(photo.jpg) center / cover */
background:
radial-gradient(circle at 70% 30%, #fde047 0 14%, transparent 15%),
repeating-linear-gradient(115deg, #fb923c 0 14px, #f43f5e 14px 28px, #7c3aed 28px 42px);
}
.pblur-layers {
position: absolute;
inset: 40% 0 0;
}
.pblur-layers i {
position: absolute;
inset: 0;
}
.pblur-layers i:nth-child(1) {
-webkit-backdrop-filter: blur(1px);
backdrop-filter: blur(1px);
-webkit-mask: linear-gradient(transparent, #000 25%, #000 50%, transparent 75%);
mask: linear-gradient(transparent, #000 25%, #000 50%, transparent 75%);
}
.pblur-layers i:nth-child(2) {
-webkit-backdrop-filter: blur(3px);
backdrop-filter: blur(3px);
-webkit-mask: linear-gradient(transparent 25%, #000 50%, #000 75%, transparent);
mask: linear-gradient(transparent 25%, #000 50%, #000 75%, transparent);
}
.pblur-layers i:nth-child(3) {
-webkit-backdrop-filter: blur(6px);
backdrop-filter: blur(6px);
-webkit-mask: linear-gradient(transparent 50%, #000 75%);
mask: linear-gradient(transparent 50%, #000 75%);
}
.pblur-layers i:nth-child(4) {
-webkit-backdrop-filter: blur(12px);
backdrop-filter: blur(12px);
-webkit-mask: linear-gradient(transparent 75%, #000);
mask: linear-gradient(transparent 75%, #000);
}
.pblur figcaption {
position: absolute;
right: 14px;
bottom: 12px;
left: 14px;
color: #fff;
font: 700 15px system-ui, sans-serif;
text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
```
### Notes
- This CSS Progressive Blur is 60 lines of pure CSS (1.6 KB) with no JavaScript and no dependencies. It uses linear gradients, radial gradients, text shadows and backdrop filters.
- backdrop filters: Includes the -webkit- prefix for older Safari.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Grainy Glass Panel
> A frosted glass panel with a subtle film-grain texture from an inline SVG noise filter, shown as a now-playing widget.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: glassmorphism, noise, grain, texture, feturbulence, music player
- Live preview: https://copy-css.com/snippets/grainy-glass-panel
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Night Drive
Coastline
```
### CSS
```css
.grain-glass {
display: flex;
align-items: center;
gap: 14px;
width: 250px;
padding: 14px;
border: 1px solid rgba(255, 255, 255, 0.25);
border-radius: 20px;
background:
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E"),
rgba(255, 255, 255, 0.14);
-webkit-backdrop-filter: blur(22px);
backdrop-filter: blur(22px);
box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.5);
color: #fff;
font-family: system-ui, sans-serif;
}
.grain-glass-art {
flex: none;
width: 56px;
height: 56px;
border-radius: 12px;
background: conic-gradient(from 200deg, #fbbf24, #f472b6, #818cf8, #fbbf24);
}
.grain-glass > div {
flex: 1;
}
.grain-glass p {
margin: 0;
}
.grain-glass-title {
font-size: 15px;
font-weight: 700;
}
.grain-glass-artist {
font-size: 13px;
opacity: 0.75;
}
.grain-glass-bar {
display: block;
height: 4px;
margin-top: 8px;
border-radius: 999px;
background: linear-gradient(90deg, #fff 42%, rgba(255, 255, 255, 0.25) 0);
}
```
### Notes
- This CSS Grainy Glass Panel is 51 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses linear gradients, conic gradients, box shadows and backdrop filters.
- backdrop filters: Includes the -webkit- prefix for older Safari.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Grayscale to Color
> An image that sits in black and white and smoothly fades into full color on hover or keyboard focus.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: grayscale, filter, image hover, black and white, gallery, logos
- Live preview: https://copy-css.com/snippets/grayscale-to-color
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.gray-hover {
display: block;
width: 240px;
overflow: hidden;
border-radius: 16px;
}
.gray-hover img {
display: block;
width: 100%;
height: auto;
filter: grayscale(1) contrast(1.05);
transition: filter 0.5s ease;
}
.gray-hover:hover img,
.gray-hover:focus-visible img {
filter: none;
}
.gray-hover:focus-visible {
outline: 3px solid #7c3aed;
outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
.gray-hover img {
transition: none;
}
}
```
### Notes
- This CSS Grayscale to Color is 30 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions, filters, keyboard focus styles and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Duotone Image
> Maps any photo to two brand colors with blend modes, then shows the original image on hover.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: duotone, mix-blend-mode, image filter, brand colors, photo effect, hover
- Live preview: https://copy-css.com/snippets/duotone-image
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.duotone {
--light: #fde68a;
--dark: #9d174d;
position: relative;
width: 240px;
overflow: hidden;
border-radius: 16px;
background: var(--light);
isolation: isolate;
}
.duotone img {
display: block;
width: 100%;
height: auto;
filter: grayscale(1) contrast(1.1);
mix-blend-mode: multiply;
}
.duotone::after {
content: "";
position: absolute;
inset: 0;
background: var(--dark);
mix-blend-mode: lighten;
pointer-events: none;
transition: opacity 0.4s ease;
}
.duotone:hover img {
filter: none;
mix-blend-mode: normal;
}
.duotone:hover::after {
opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
.duotone::after {
transition: none;
}
}
```
### Notes
- This CSS Duotone Image is 43 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses transitions, filters, blend modes and custom properties.
- Customize with: `--light`, `--dark`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Ken Burns Effect
> A slow, cinematic zoom-and-pan on a hero image, looping back and forth inside a cropped frame.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: ken burns, slow zoom, pan, hero image, animation, slideshow
- Live preview: https://copy-css.com/snippets/ken-burns-effect
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.ken-burns {
width: 260px;
height: 160px;
overflow: hidden;
border-radius: 14px;
}
.ken-burns img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
transform-origin: 70% 40%;
animation: ken-burns-move 14s ease-in-out infinite alternate;
}
@keyframes ken-burns-move {
from {
transform: scale(1) translate(0, 0);
}
to {
transform: scale(1.3) translate(-4%, 3%);
}
}
@media (prefers-reduced-motion: reduce) {
.ken-burns img {
animation: none;
}
}
```
### Notes
- This CSS Ken Burns Effect is 31 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses keyframe animations, transforms and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Image Swap on Hover
> A shop thumbnail that crossfades to a second product photo on hover, like most online stores do.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: product image, second image, hover swap, ecommerce, crossfade, shop
- Live preview: https://copy-css.com/snippets/image-swap-hover
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.img-swap {
display: grid;
width: 200px;
overflow: hidden;
border-radius: 14px;
}
.img-swap img {
grid-area: 1 / 1;
display: block;
width: 100%;
height: auto;
transition: opacity 0.4s ease, transform 0.6s ease;
}
.img-swap img + img {
opacity: 0;
}
.img-swap:hover img + img,
.img-swap:focus-visible img + img {
opacity: 1;
transform: scale(1.04);
}
.img-swap:focus-visible {
outline: 3px solid #1c1917;
outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
.img-swap img {
transition: none;
}
}
```
### Notes
- This CSS Image Swap on Hover is 35 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions, transforms, CSS Grid and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Polaroid Photo
> A tilted instant-photo frame with a handwritten caption and a strip of tape that straightens on hover.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: polaroid, photo frame, tape, scrapbook, rotate, caption
- Live preview: https://copy-css.com/snippets/polaroid-photo
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Summer '26
```
### CSS
```css
.polaroid {
position: relative;
width: 180px;
margin: 0;
padding: 10px 10px 0;
background: #fffdf8;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 14px 28px -12px rgba(0, 0, 0, 0.35);
transform: rotate(-4deg);
transition: transform 0.3s ease;
}
.polaroid::before {
content: "";
position: absolute;
top: -12px;
left: 50%;
width: 70px;
height: 22px;
background: rgba(253, 230, 138, 0.75);
transform: translateX(-50%) rotate(3deg);
}
.polaroid img {
display: block;
width: 100%;
height: auto;
aspect-ratio: 6 / 5;
object-fit: cover;
}
.polaroid figcaption {
padding: 8px 0 12px;
color: #44403c;
font: 20px "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
text-align: center;
}
.polaroid:hover {
transform: rotate(0) scale(1.03);
}
@media (prefers-reduced-motion: reduce) {
.polaroid {
transition: none;
}
}
```
### Notes
- This CSS Polaroid Photo is 46 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, transforms, box shadows and aspect-ratio.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Clip Path Shapes
> Three ready-made clip-path classes that crop images into a circle, a hexagon and a slanted card.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: clip-path, hexagon, circle, polygon, image shapes, mask
- Live preview: https://copy-css.com/snippets/clip-path-shapes
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.clip-shapes {
display: flex;
gap: 14px;
}
.clip-shapes img {
display: block;
width: 80px;
height: 80px;
object-fit: cover;
transition: clip-path 0.4s ease;
}
.clip-circle {
clip-path: circle(50%);
}
.clip-hexagon {
clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
}
.clip-slant {
clip-path: polygon(0 0, 100% 12%, 100% 100%, 0 88%);
}
.clip-shapes img:hover {
clip-path: inset(0 round 12px);
}
@media (prefers-reduced-motion: reduce) {
.clip-shapes img {
transition: none;
}
}
```
### Notes
- This CSS Clip Path Shapes is 34 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses transitions, clip paths, Flexbox and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Scroll Progress Bar
> A reading progress bar pinned to the top of the page that fills as you scroll, driven by animation-timeline: scroll().
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: scroll-driven, reading progress, animation-timeline, scroll, indicator, blog
- Live preview: https://copy-css.com/snippets/scroll-progress-bar
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.scroll-progress {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 100;
height: 4px;
background: linear-gradient(90deg, #6366f1, #ec4899);
transform-origin: 0 50%;
animation: scroll-progress-grow linear both;
animation-timeline: scroll();
}
@keyframes scroll-progress-grow {
from {
transform: scaleX(0);
}
to {
transform: scaleX(1);
}
}
@supports not (animation-timeline: scroll()) {
.scroll-progress {
display: none;
}
}
```
### Notes
- This CSS Scroll Progress Bar is 28 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses scroll-driven animations, keyframe animations, transforms and linear gradients.
- scroll-driven animations: Chrome and Edge 115+ and Safari 26+. Firefox support is very recent; browsers without it skip the animation and show the content as is.
- It animates; wrap the animation in `@media (prefers-reduced-motion: no-preference)` or disable it under `reduce`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Fade In on Scroll
> Items fade and slide up as they scroll into view, with animation-timeline: view() instead of a scroll library.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: scroll-driven, reveal, view timeline, fade up, animate on scroll, aos
- Live preview: https://copy-css.com/snippets/fade-in-on-scroll
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Plan
Design
Build
Launch
```
### CSS
```css
.scroll-reveal {
display: grid;
gap: 16px;
margin: 0;
padding: 0;
list-style: none;
font-family: system-ui, sans-serif;
}
.scroll-reveal li {
padding: 22px;
border-radius: 14px;
background: #fff;
box-shadow: 0 6px 18px -10px rgba(20, 83, 45, 0.35);
color: #14532d;
font-size: 18px;
font-weight: 700;
}
@supports (animation-timeline: view()) {
.scroll-reveal li {
animation: scroll-reveal-in linear both;
animation-timeline: view();
animation-range: entry 0% cover 30%;
}
}
@keyframes scroll-reveal-in {
from {
opacity: 0;
transform: translateY(40px) scale(0.96);
}
to {
opacity: 1;
transform: none;
}
}
@media (prefers-reduced-motion: reduce) {
.scroll-reveal li {
animation: none;
}
}
```
### Notes
- This CSS Fade In on Scroll is 44 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses scroll-driven animations, keyframe animations, transforms and box shadows.
- scroll-driven animations: Chrome and Edge 115+ and Safari 26+. Firefox support is very recent; browsers without it skip the animation and show the content as is.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Shrinking Header
> A sticky header that shrinks, gains a background and casts a shadow over the first 120px of scrolling, in pure CSS.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: sticky header, shrink on scroll, scroll-driven, navbar, animation-range, scroll timeline
- Live preview: https://copy-css.com/snippets/shrinking-header
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Acme
```
### CSS
```css
.shrink-head {
position: sticky;
top: 0;
z-index: 10;
display: flex;
justify-content: space-between;
align-items: center;
padding: 22px 20px;
color: #0f172a;
font-family: system-ui, sans-serif;
}
.shrink-head-logo {
color: inherit;
font-size: 24px;
font-weight: 800;
text-decoration: none;
}
.shrink-head nav {
display: flex;
gap: 16px;
}
.shrink-head nav a {
color: #475569;
font-size: 14px;
font-weight: 600;
text-decoration: none;
}
.shrink-head a:focus-visible {
outline: 2px solid #2563eb;
outline-offset: 3px;
border-radius: 2px;
}
@supports (animation-timeline: scroll()) {
.shrink-head {
animation: shrink-head-pad linear both;
animation-timeline: scroll();
animation-range: 0 120px;
}
.shrink-head-logo {
animation: shrink-head-logo linear both;
animation-timeline: scroll();
animation-range: 0 120px;
}
}
@keyframes shrink-head-pad {
to {
padding-block: 10px;
background: rgba(255, 255, 255, 0.9);
box-shadow: 0 4px 16px -8px rgba(15, 23, 42, 0.3);
}
}
@keyframes shrink-head-logo {
to {
font-size: 18px;
}
}
@media (prefers-reduced-motion: reduce) {
.shrink-head,
.shrink-head-logo {
animation: none;
}
}
```
### Notes
- This CSS Shrinking Header is 71 lines of pure CSS (1.2 KB) with no JavaScript and no dependencies. It uses scroll-driven animations, keyframe animations, box shadows and Flexbox.
- scroll-driven animations: Chrome and Edge 115+ and Safari 26+. Firefox support is very recent; browsers without it skip the animation and show the content as is.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Parallax Scrolling
> An image that moves slower than the page inside its frame as it scrolls past, using a view() scroll timeline.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: parallax, scroll-driven, view timeline, image, depth, hero
- Live preview: https://copy-css.com/snippets/parallax-scrolling
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.parallax-frame {
width: 100%;
max-width: 280px;
height: 160px;
margin: 0 auto;
overflow: hidden;
border-radius: 16px;
}
.parallax-frame img {
display: block;
width: 100%;
height: 140%;
object-fit: cover;
}
@supports (animation-timeline: view()) {
.parallax-frame img {
animation: parallax-frame-shift linear both;
animation-timeline: view();
}
}
@keyframes parallax-frame-shift {
from {
transform: translateY(-28%);
}
to {
transform: translateY(0);
}
}
@media (prefers-reduced-motion: reduce) {
.parallax-frame img {
height: 100%;
animation: none;
}
}
```
### Notes
- This CSS Parallax Scrolling is 39 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses scroll-driven animations, keyframe animations, transforms and reduced-motion support.
- scroll-driven animations: Chrome and Edge 115+ and Safari 26+. Firefox support is very recent; browsers without it skip the animation and show the content as is.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Stacking Cards on Scroll
> Cards that pile up on top of each other as you scroll, each sticking a little lower, with plain position: sticky.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: sticky, stack, scroll, cards, position sticky, storytelling
- Live preview: https://copy-css.com/snippets/stacking-cards-scroll
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
01 · Research
02 · Prototype
03 · Test
04 · Ship
```
### CSS
```css
.stack-scroll {
display: grid;
gap: 60px;
margin: 0;
padding: 0 0 40px;
list-style: none;
font-family: system-ui, sans-serif;
}
.stack-scroll li {
position: sticky;
top: calc(16px + var(--i) * 14px);
display: flex;
align-items: flex-end;
height: 120px;
padding: 18px;
box-sizing: border-box;
border-radius: 18px;
background: hsl(calc(250 + var(--i) * 30) 85% 65%);
box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, 0.6);
color: #fff;
font-size: 20px;
font-weight: 800;
}
```
### Notes
- This CSS Stacking Cards on Scroll is 24 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses box shadows, CSS Grid, Flexbox and sticky positioning.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Marching Ants Border
> An animated dashed border whose dashes crawl around the box like a selection marquee, for drop zones and crops.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: marching ants, animated dashed border, selection, drop target, gradient, keyframes
- Live preview: https://copy-css.com/snippets/marching-ants-border
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Drop files here
```
### CSS
```css
.ants-border {
--c: #2563eb;
display: grid;
place-items: center;
width: 240px;
height: 120px;
background:
linear-gradient(90deg, var(--c) 50%, transparent 0) repeat-x 0 0 / 14px 2px,
linear-gradient(90deg, var(--c) 50%, transparent 0) repeat-x 0 100% / 14px 2px,
linear-gradient(0deg, var(--c) 50%, transparent 0) repeat-y 0 0 / 2px 14px,
linear-gradient(0deg, var(--c) 50%, transparent 0) repeat-y 100% 0 / 2px 14px,
#eff6ff;
color: #1e40af;
font: 600 15px system-ui, sans-serif;
animation: ants-border-march 0.6s linear infinite;
}
@keyframes ants-border-march {
to {
background-position: 14px 0, -14px 100%, 0 -14px, 100% 14px, 0 0;
}
}
@media (prefers-reduced-motion: reduce) {
.ants-border {
animation: none;
}
}
```
### Notes
- This CSS Marching Ants Border is 28 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients, CSS Grid and custom properties.
- Customize with: `--c`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Inverted Border Radius
> A card with a round bite taken out of its corner for a floating button, cut with a radial-gradient mask.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: inverted radius, cutout, notch, mask, radial-gradient, card corner
- Live preview: https://copy-css.com/snippets/inverted-border-radius
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
```
### CSS
```css
.ring-row {
display: flex;
gap: 18px;
}
.ring-hover {
display: grid;
place-items: center;
width: 56px;
height: 56px;
border-radius: 50%;
background: #0d9488;
color: #fff;
font: 700 20px system-ui, sans-serif;
text-decoration: none;
outline: 2px solid transparent;
outline-offset: 0;
transition: outline-offset 0.25s ease, outline-color 0.25s ease;
}
.ring-hover:hover,
.ring-hover:focus-visible {
outline-color: #0d9488;
outline-offset: 5px;
}
@media (prefers-reduced-motion: reduce) {
.ring-hover {
transition: none;
}
}
```
### Notes
- This CSS Outline Offset Hover is 31 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses transitions, CSS Grid, Flexbox and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Animated Waves
> Layered SVG waves rolling along the bottom of a hero section at different speeds, all in background layers.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: waves, svg background, hero, ocean, layered, animation
- Live preview: https://copy-css.com/snippets/animated-waves
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Ride the wave
```
### CSS
```css
.wave-hero {
position: relative;
display: grid;
place-items: center;
width: 280px;
height: 160px;
overflow: hidden;
border-radius: 18px;
background: linear-gradient(180deg, #0ea5e9, #1e3a8a);
color: #fff;
font-family: system-ui, sans-serif;
}
.wave-hero h3 {
position: relative;
z-index: 1;
margin: 0 0 30px;
font-size: 22px;
}
.wave-hero::before,
.wave-hero::after {
content: "";
position: absolute;
right: 0;
bottom: 0;
left: 0;
height: 50px;
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0 30 Q100 0 200 30 T400 30 V60 H0Z' fill='%23fff'/%3E%3C/svg%3E") repeat-x 0 100% / 200px 100%;
animation: wave-hero-roll 6s linear infinite;
}
.wave-hero::before {
height: 60px;
opacity: 0.35;
animation-duration: 9s;
animation-direction: reverse;
}
.wave-hero::after {
opacity: 0.8;
}
@keyframes wave-hero-roll {
to {
background-position-x: 200px;
}
}
@media (prefers-reduced-motion: reduce) {
.wave-hero::before,
.wave-hero::after {
animation: none;
}
}
```
### Notes
- This CSS Animated Waves is 55 lines of pure CSS (1.1 KB) with no JavaScript and no dependencies. It uses keyframe animations, linear gradients, CSS Grid and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Tooltip Positions
> Accessible tooltips with arrows that open above, below, left or right, set with a single data attribute.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: tooltip, top, bottom, left, right, arrow, aria-describedby
- Live preview: https://copy-css.com/snippets/tooltip-positions
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Shown aboveShown belowTo the rightTo the left
```
### CSS
```css
.tooltip-pos-grid {
display: grid;
grid-template-columns: auto auto;
gap: 44px 40px;
font-family: system-ui, sans-serif;
}
.tooltip-pos {
--tip-bg: #1e293b;
position: relative;
display: inline-block;
}
.tooltip-pos button {
padding: 8px 14px;
border: 1px solid #cbd5e1;
border-radius: 8px;
background: #fff;
color: #0f172a;
font: 500 14px system-ui, sans-serif;
cursor: pointer;
}
.tooltip-pos button:focus-visible {
outline: 2px solid #2563eb;
outline-offset: 2px;
}
.tooltip-pos [role="tooltip"] {
position: absolute;
z-index: 10;
padding: 6px 10px;
border-radius: 6px;
background: var(--tip-bg);
color: #fff;
font-size: 13px;
white-space: nowrap;
opacity: 0;
visibility: hidden;
pointer-events: none;
transition: opacity 0.15s ease, visibility 0.15s;
}
.tooltip-pos [role="tooltip"]::after {
content: "";
position: absolute;
border: 5px solid transparent;
}
.tooltip-pos:hover [role="tooltip"],
.tooltip-pos:focus-within [role="tooltip"] {
opacity: 1;
visibility: visible;
}
.tooltip-pos[data-pos="top"] [role="tooltip"] {
bottom: calc(100% + 8px);
left: 50%;
translate: -50% 0;
}
.tooltip-pos[data-pos="top"] [role="tooltip"]::after {
top: 100%;
left: 50%;
margin-left: -5px;
border-top-color: var(--tip-bg);
}
.tooltip-pos[data-pos="bottom"] [role="tooltip"] {
top: calc(100% + 8px);
left: 50%;
translate: -50% 0;
}
.tooltip-pos[data-pos="bottom"] [role="tooltip"]::after {
bottom: 100%;
left: 50%;
margin-left: -5px;
border-bottom-color: var(--tip-bg);
}
.tooltip-pos[data-pos="right"] [role="tooltip"] {
top: 50%;
left: calc(100% + 8px);
translate: 0 -50%;
}
.tooltip-pos[data-pos="right"] [role="tooltip"]::after {
top: 50%;
right: 100%;
margin-top: -5px;
border-right-color: var(--tip-bg);
}
.tooltip-pos[data-pos="left"] [role="tooltip"] {
top: 50%;
right: calc(100% + 8px);
translate: 0 -50%;
}
.tooltip-pos[data-pos="left"] [role="tooltip"]::after {
top: 50%;
left: 100%;
margin-top: -5px;
border-left-color: var(--tip-bg);
}
@media (prefers-reduced-motion: reduce) {
.tooltip-pos [role="tooltip"] {
transition: none;
}
}
```
### Notes
- This CSS Tooltip Positions is 112 lines of pure CSS (2.1 KB) with no JavaScript and no dependencies. It uses transitions, CSS Grid, keyboard focus styles and custom properties.
- Customize with: `--tip-bg`.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Info Icon Tooltip
> A small "i" help button beside a form label that shows a multi-line hint bubble on hover or keyboard focus.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: info icon, help, tooltip, form hint, multiline, aria-describedby
- Live preview: https://copy-css.com/snippets/info-icon-tooltip
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
The 3 digits printed on the back of your card, next to the signature strip.
```
### CSS
```css
.info-tip-field {
display: grid;
grid-template-columns: auto 1fr;
align-items: center;
gap: 6px 8px;
width: 220px;
color: #111827;
font: 600 14px system-ui, sans-serif;
}
.info-tip-field input {
grid-column: 1 / -1;
padding: 9px 11px;
border: 1.5px solid #d1d5db;
border-radius: 8px;
font: 15px system-ui, sans-serif;
}
.info-tip-field input:focus-visible {
border-color: #4f46e5;
outline: 3px solid rgba(79, 70, 229, 0.2);
outline-offset: 0;
}
.info-tip {
position: relative;
justify-self: start;
}
.info-tip button {
display: grid;
place-items: center;
width: 18px;
height: 18px;
padding: 0;
border: 1.5px solid #9ca3af;
border-radius: 50%;
background: #fff;
color: #6b7280;
font: italic 700 11px Georgia, serif;
cursor: help;
}
.info-tip button:hover,
.info-tip button:focus-visible {
border-color: #4f46e5;
color: #4f46e5;
}
.info-tip button:focus-visible {
outline: 2px solid #4f46e5;
outline-offset: 2px;
}
.info-tip [role="tooltip"] {
position: absolute;
bottom: calc(100% + 10px);
left: -12px;
z-index: 10;
width: 200px;
padding: 10px 12px;
border-radius: 10px;
background: #312e81;
color: #e0e7ff;
font-size: 13px;
font-weight: 400;
line-height: 1.45;
opacity: 0;
visibility: hidden;
transform: translateY(4px);
transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.info-tip [role="tooltip"]::after {
content: "";
position: absolute;
top: 100%;
left: 16px;
border: 6px solid transparent;
border-top-color: #312e81;
}
.info-tip:hover [role="tooltip"],
.info-tip:focus-within [role="tooltip"] {
opacity: 1;
visibility: visible;
transform: none;
}
@media (prefers-reduced-motion: reduce) {
.info-tip [role="tooltip"] {
transition: none;
}
}
```
### Notes
- This CSS Info Icon Tooltip is 94 lines of pure CSS (1.8 KB) with no JavaScript and no dependencies. It uses transitions, transforms, CSS Grid and keyboard focus styles.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## User Hover Card
> A rich tooltip that previews a user profile when you hover or tab to an @mention, and stays open while you use it.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: hover card, rich tooltip, profile preview, mention, focus-within, popover
- Live preview: https://copy-css.com/snippets/user-hover-card
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Thanks to
@miraMOMira OkaforDesign engineer. Builds tiny tools.
for the review.
```
### CSS
```css
.mention-text {
max-width: 260px;
margin: 0;
color: #44403c;
font: 16px/1.6 system-ui, sans-serif;
}
.hover-card {
position: relative;
display: inline-block;
}
.hover-card > a {
color: #7c3aed;
font-weight: 700;
text-decoration: none;
}
.hover-card > a:focus-visible {
outline: 2px solid #7c3aed;
outline-offset: 2px;
border-radius: 3px;
}
.hover-card-panel {
position: absolute;
top: 100%;
left: 50%;
z-index: 10;
display: grid;
gap: 2px;
width: 200px;
margin-top: 8px;
padding: 14px;
border: 1px solid #e7e5e4;
border-radius: 14px;
background: #fff;
box-shadow: 0 16px 32px -12px rgba(28, 25, 23, 0.3);
color: #57534e;
font-size: 13px;
line-height: 1.4;
opacity: 0;
visibility: hidden;
translate: -50% 6px;
transition: opacity 0.2s ease, translate 0.2s ease, visibility 0.2s;
}
.hover-card-panel::before {
content: "";
position: absolute;
bottom: 100%;
left: 0;
right: 0;
height: 10px;
}
.hover-card:hover .hover-card-panel,
.hover-card:focus-within .hover-card-panel {
opacity: 1;
visibility: visible;
translate: -50% 0;
}
.hover-card-avatar {
display: grid;
place-items: center;
width: 40px;
height: 40px;
margin-bottom: 6px;
border-radius: 50%;
background: linear-gradient(135deg, #a78bfa, #6d28d9);
color: #fff;
font-size: 14px;
font-weight: 700;
}
.hover-card-panel strong {
color: #1c1917;
font-size: 15px;
}
@media (prefers-reduced-motion: reduce) {
.hover-card-panel {
transition: none;
}
}
```
### Notes
- This CSS User Hover Card is 86 lines of pure CSS (1.5 KB) with no JavaScript and no dependencies. It uses transitions, linear gradients, box shadows and CSS Grid.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Popover Toggletip
> A click-to-open info bubble using the native popover attribute, placed above its button with CSS anchor positioning.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: popover, toggletip, click tooltip, anchor positioning, popovertarget, no javascript
- Live preview: https://copy-css.com/snippets/popover-toggletip
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
Free shipping on orders over $50. Returns are free within 30 days.
```
### CSS
```css
.toggletip-btn {
display: grid;
place-items: center;
width: 36px;
height: 36px;
border: 0;
border-radius: 50%;
background: #0891b2;
color: #fff;
font: 700 16px system-ui, sans-serif;
cursor: pointer;
anchor-name: --toggletip;
}
.toggletip-btn:focus-visible {
outline: 2px solid #0891b2;
outline-offset: 3px;
}
.toggletip {
width: 220px;
padding: 12px 14px;
border: 0;
border-radius: 12px;
background: #164e63;
box-shadow: 0 12px 28px -10px rgba(8, 51, 68, 0.5);
color: #ecfeff;
font: 14px/1.45 system-ui, sans-serif;
}
@supports (position-area: top) {
.toggletip {
position-anchor: --toggletip;
position-area: top;
position-try-fallbacks: flip-block;
margin: 0 0 10px;
}
}
```
### Notes
- This CSS Popover Toggletip is 38 lines of pure CSS (0.7 KB) with no JavaScript and no dependencies. It uses anchor positioning, box shadows, CSS Grid and keyboard focus styles.
- anchor positioning: Chrome and Edge 125+, Safari 26+ and Firefox 147+. Older browsers use the @supports fallback position.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
## Definition Tooltip
> Explains a term inside a sentence: a dotted-underlined word that reveals a short definition on hover or focus.
- Category: [CSS Effects](https://copy-css.com/category/effects)
- Tags: definition, glossary, dfn, inline tooltip, dotted underline, jargon
- Live preview: https://copy-css.com/snippets/definition-tooltip
- License: Free for personal and commercial use. No signup, no attribution required.
### HTML
```html
The layout uses
subgridA grid item that lines up its children with the parent grid's tracks.
so the card titles align.
```
### CSS
```css
.define-text {
position: relative;
max-width: 260px;
margin: 0;
color: #451a03;
font: 17px/1.6 Georgia, "Times New Roman", serif;
}
.define {
text-decoration: underline dotted #b45309 2px;
text-underline-offset: 4px;
cursor: help;
}
.define:focus-visible {
outline: 2px solid #b45309;
outline-offset: 2px;
border-radius: 2px;
}
.define-tip {
position: absolute;
top: calc(100% + 8px);
left: 0;
z-index: 10;
width: 100%;
padding: 10px 12px;
box-sizing: border-box;
border-left: 3px solid #f59e0b;
border-radius: 4px 10px 10px 4px;
background: #fff;
box-shadow: 0 10px 24px -10px rgba(120, 53, 15, 0.35);
color: #78350f;
font: 14px/1.45 system-ui, sans-serif;
opacity: 0;
visibility: hidden;
transition: opacity 0.15s ease, visibility 0.15s;
}
.define:hover + .define-tip,
.define:focus + .define-tip {
opacity: 1;
visibility: visible;
}
@media (prefers-reduced-motion: reduce) {
.define-tip {
transition: none;
}
}
```
### Notes
- This CSS Definition Tooltip is 50 lines of pure CSS (1.0 KB) with no JavaScript and no dependencies. It uses transitions, box shadows, keyboard focus styles and reduced-motion support.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.