Collection of free CSS box-shadow code examples from Codepen and other resources.

  1. CSS Text Shadow Effects
Demo image: Saturated vs Desaturated Box-Shadow

Creator

  • Adam Argyle

Programming language

  • HTML / CSS

Information a code

Saturated vs Desaturated Box-Shadow

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies:

Demo image: Dropplets

Creator

  • Oscar Salazar

Programming language

  • HTML / CSS (SCSS)

Information a code

Dropplets

SVG filters and CSS shadows.

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies:

Creator

  • yoksel

Programming language

  • HTML / CSS (SCSS)

Information a code

Box Shadow Piano

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: no

Dependencies:

Demo image: Parallax Shadows (Mobile-Friendly)

Creator

  • Janne Aukia

Programming language

  • HTML / CSS / JS

Information a code

Parallax Shadows (Mobile-Friendly)

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies:

Demo image: Image Shadows

Creator

  • Oscar Marcelo

Programming language

  • HTML (Pug) / CSS (Sass)

Information a code

Image Shadows

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: no

Dependencies:

Creator

  • Andrew Spencer

Programming language

  • HTML / CSS (SCSS)

Information a code

Multiple Shadows

Playing with placing multiple shadows on an element. This gives it the look of depth with a “natural” shadow, as if there was actually a light shining on the page.

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies:

Demo image: CSS Pixel Animation

Creator

  • Lorena Sarasua

Programming language

  • HTML / CSS (SCSS)

Information a code

CSS Pixel Animation

8 bit pixelated woman made with box-shadows on a single div.

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: no

Dependencies:

Creator

  • Giana

Programming language

  • HTML / CSS (SCSS)

Information a code

Button Hover Effects with box-shadow

Making some basic animations with box-shadows. No extra elements or even pseudo elements required. Tips: – We’re setting all the blurs to 0 since we want a solid fill; – Add the inset keyword so the box-shadow is on the inside of the element; – Animating the inset shadow on hover looks like the element is filling in from whatever side you specify ([top] and [left] accept negative values to become [bottom] and [right]); – Multiple shadows can be stacked; – If you’re animating multiple shadows, be sure to keep the same number of shadows so the animation is smooth. Otherwise, you’ll get something choppy.

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: no

Dependencies:

Creator

  • timaronan

Programming language

  • HTML (Pug) / CSS (SCSS)

Information a code

box-shadow Spill

Using offsetting inset and outer box-shadows to create a 3D-like effect.

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies:

Creator

  • Jhey

Programming language

  • HTML (Pug) / CSS (Stylus)

Information a code

box-shadow Pseudo Loaders

Leveraging the use of box-shadow to create interesting loading effects with just pseudo elements. Just by adding a class to an element you can get a cool loading animation in an overlay.

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: no

Dependencies:

Creator

  • Drew McConville

Programming language

  • HTML / CSS (SCSS) / JS

Information a code

Dynamic Box Shadow

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: no

Dependencies: jquery.js

Demo image: Isolating CSS Box Shadows

Creator

  • TundraTech

Programming language

  • HTML / CSS (SCSS)

Information a code

Isolating CSS Box Shadows

A simple & often misunderstood CSS fundamental. To isolate a single shadow we apply a negative spread and offset in the desired direction, then add a blur radius of equal distance to compensate. For inset shadows, the spread remains constant but we apply an offset in the opposite(-ve) direction. For multiple sides/shadows, simply combine any of the desired single-side rules into a comma separated list.

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: yes

Dependencies:

Demo image: Material Design Box Shadows

Creator

  • Samuel Thornton

Programming language

  • HTML / CSS

Information a code

Material Design Box Shadows

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: no

Dependencies:

Creator

  • yoksel

Programming language

  • HTML / CSS (SCSS)

Information a code

Live Stripes

Programming language box-shadows. CSS only.

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: no

Dependencies:

Creator

  • Doug Avery

Programming language

  • HTML / CSS

Information a code

39 Ridiculous Things To Do With CSS3 Box Shadows

Browser Support: Chrome, Edge, Firefox, Opera, Safari

Responsive: no

Dependencies: