Category

Code Snippets

67 articles

43 CSS Loaders You Can Copy + What Keeps Them Smooth
Code Snippets
43 CSS Loaders You Can Copy + What Keeps Them Smooth

Most loading spinners on the web are just a keyframe animation sitting in the stylesheet. Nobody needs a GIF or an animation library to…

Dec 16, 2025
CSS Star Rating: 37 Examples, No JavaScript Needed
Code Snippets
CSS Star Rating: 37 Examples, No JavaScript Needed

Stars on a page are easy to get wrong because two very different widgets look almost the same. Some only report a score. Others…

Dec 16, 2025
35 CSS Footers + How to Pin One to the Bottom
Code Snippets
35 CSS Footers + How to Pin One to the Bottom

Footer bugs mostly turn up on pages with very little content. The footer floats halfway up the screen with blank space under it, or…

Dec 16, 2025
CSS Perspective: How It Works + 27 3D Examples
Code Snippets
CSS Perspective: How It Works + 27 3D Examples

Rotate a card with rotateY and it just looks like a flat shape getting narrower. Perspective sets the viewing distance between the viewer and…

Dec 16, 2025
35 CSS Timelines + How to Build Vertical and Horizontal
Code Snippets
35 CSS Timelines + How to Build Vertical and Horizontal

Changelogs, resumes, project histories and product roadmaps keep asking for the same thing, which is dated events in order along a line. HTML and…

Dec 15, 2025
41 CSS Chat Box Examples You Can Drop Into Any Page
Code Snippets
41 CSS Chat Box Examples You Can Drop Into Any Page

Most of a chat box is a flex column with rounded corners. Bubbles, a header, a scrolling message list and an input bar at…

Dec 15, 2025
28 CSS Slideshows + 4 Ways to Build One
Code Snippets
28 CSS Slideshows + 4 Ways to Build One

A lot of sliders load a script just to change which image is showing. CSS can handle that part on its own. Hero banners,…

Dec 15, 2025
41 CSS Dashboard Templates and How to Lay One Out
Code Snippets
41 CSS Dashboard Templates and How to Lay One Out

Plenty of internal admin panels and monitoring screens carry a full component framework just to get a sidebar and a few cards onto the…

Dec 14, 2025
38 CSS Border Animations + How to Avoid Layout Shift
Code Snippets
38 CSS Border Animations + How to Avoid Layout Shift

Most border animation on a page is a color change on hover. One transition line does it, and it’s what buttons and pricing cards…

Dec 14, 2025
36 Cool CSS Buttons You Can Copy and Customize
Code Snippets
36 Cool CSS Buttons You Can Copy and Customize

You can make a button feel finished with CSS alone. No images, no JavaScript, just hover, focus and press states that do something visible.…

Dec 14, 2025
43 CSS Flip Cards + the Perspective Values That Work
Code Snippets
43 CSS Flip Cards + the Perspective Values That Work

Most flip card tutorials stop once the card turns on hover. That part is easy, and it’s also where the trouble starts, because a…

Dec 14, 2025
41 JavaScript Menus + the Pattern Your Nav Needs
Code Snippets
41 JavaScript Menus + the Pattern Your Nav Needs

A class toggle is enough to show and hide a panel. The W3C’s ARIA Authoring Practices Guide (2025) still points most websites somewhere else,…

Dec 14, 2025
CSS Lists: ::marker, Counters and 43 Styled Examples
Code Snippets
CSS Lists: ::marker, Counters and 43 Styled Examples

Most list styling problems come down to the marker, the bullet or number sitting in front of each item. CSS handles it through list-style-type,…

Dec 13, 2025
Product Card Design: 40 Examples and What to Put on One
Code Snippets
Product Card Design: 40 Examples and What to Put on One

Baymard Institute’s 2023 benchmark found that 50% of ecommerce sites fail to show adequate list item attributes. Test participants dismissed relevant products or left…

Dec 13, 2025
31 CSS Animation Libraries + Which One to Install
Code Snippets
31 CSS Animation Libraries + Which One to Install

Licensing is the part of CSS animation libraries that gets the least attention. Hover.css requires a paid license for commercial work, while the Animate.css…

Dec 13, 2025
41 CSS Blockquotes + the Markup Quotes Should Use
Code Snippets
41 CSS Blockquotes + the Markup Quotes Should Use

Out of the box, a blockquote is an indented block of text and not much else. The browser applies a 40px indent and stops…

Dec 13, 2025
42 CSS Dividers: Waves, Gradients and Section Breaks
Code Snippets
42 CSS Dividers: Waves, Gradients and Section Breaks

Borders, gradients, pseudo-elements and clipped shapes can all split a page into sections without a single image file. Plenty of pages add one out…

Dec 13, 2025
42 CSS Cards + the Layout Rules Behind Them
Code Snippets
42 CSS Cards + the Layout Rules Behind Them

Most card bugs I’ve run into had nothing to do with shadows or border radius. The markup looked fine with one card on the…

Dec 13, 2025
43 CSS Speech Bubbles + How to Build the Tail
Code Snippets
43 CSS Speech Bubbles + How to Build the Tail

Add a box-shadow to a bubble that uses clip-path and watch it vanish. MDN documents that clip-path hides every part of an element outside…

Dec 12, 2025
CSS Masonry: grid-lanes, Browser Support and 33 Examples
Code Snippets
CSS Masonry: grid-lanes, Browser Support and 33 Examples

Pinterest-style card walls used to mean JavaScript. CSS can now do it natively with display: grid-lanes, which drops each item into the lane with…

Dec 12, 2025
41 CSS Card Hover Effects + the Ones That Stay Smooth
Code Snippets
41 CSS Card Hover Effects + the Ones That Stay Smooth

CSS card hover effects need no JavaScript. Put a transition on the card’s resting rule, change transform or box-shadow inside :hover, and the card…

Dec 12, 2025
42 JavaScript Text Animation Examples You Can Copy
Code Snippets
42 JavaScript Text Animation Examples You Can Copy

When text animation goes wrong, the splitting step is usually to blame, not the motion. Adrian Roselli’s February 2026 tests of GSAP’s own SplitText…

Dec 12, 2025
41 CSS Progress Bars + the progress Element Explained
Code Snippets
41 CSS Progress Bars + the progress Element Explained

Most progress bars look identical on screen whether they’re built well or badly. A styled div and a native progress element both fill from…

Dec 12, 2025
CSS Ripple Effect: 41 Examples and the Code for Each
Code Snippets
CSS Ripple Effect: 41 Examples and the Code for Each

A button that only changes color on :hover or :active confirms the press happened and nothing more. The ripple adds the where: a fading…

Dec 11, 2025
44 CSS Parallax Examples + the 3 Methods That Work
Code Snippets
44 CSS Parallax Examples + the 3 Methods That Work

For years, getting a background to trail behind the text meant a JavaScript scroll listener and a transform rewritten on every frame. CSS can…

Dec 11, 2025
43 CSS Glassmorphism Examples + the 3-Line Recipe
Code Snippets
43 CSS Glassmorphism Examples + the 3-Line Recipe

Almost nobody was using backdrop-filter in 2018. Chromium engineer Mason Freed put unprefixed usage at about 0.0003% in November of that year (W3C CSS…

Dec 10, 2025
CSS Select: 35 Styled Dropdowns and the New base-select
Code Snippets
CSS Select: 35 Styled Dropdowns and the New base-select

The open list on a select element stayed out of CSS reach for a long time. Chrome 135 changed that when it went stable…

Dec 6, 2025
34 CSS 3D Buttons + the Box-Shadow Trick Behind Them
Code Snippets
34 CSS 3D Buttons + the Box-Shadow Trick Behind Them

Most 3D buttons on the web are a single element with a solid shadow underneath it. A zero-blur box-shadow acts as the bottom edge,…

Dec 5, 2025
CSS Input Text: 39 Examples With Copy-Paste CSS
Code Snippets
CSS Input Text: 39 Examples With Copy-Paste CSS

Most people restyle the border first when they style a CSS input text field, which is also the point where accessibility rules start to…

Dec 4, 2025
41 CSS Gallery Examples + Grid, Masonry and Lightbox
Code Snippets
41 CSS Gallery Examples + Grid, Masonry and Lightbox

Plenty of image galleries need nothing more than a list of images and a stylesheet. Grid, Flexbox or multi-column layout arranges the photos in…

Dec 3, 2025