A viewport border frame that dynamically crawls and draws around the screen edges as you scroll down the page, built with pure CSS.

Scroll-Driven Crawling Border Frame

Scroll-Driven Crawling Border Frame draws a colorful frame around the viewport as the user scrolls. Utilizing native CSS Scroll-Driven Animations (animation-timeline: scroll()) and sequence keyframes, the borders of two fixed elements expand in height and width. The styling utilizes modern oklch() color math for a vibrant gradient. Clean, pure CSS decoration with no JS overhead.

Technologies:
HTML CSS
Difficulty: Intermediate
Browser Support (as of Jun 2026):
Chrome Chrome 119+ Edge Edge 119+ Firefox Firefox (with polyfill) Safari Safari (with polyfill)
Features:
Scroll-Driven Timeline Zero JavaScript OKLCH Color Space
Code by: Giana Giana
License: MIT
Webpage layout featuring a vintage airmail envelope border with diagonal red and blue stripes using CSS gradients

Retro Airmail Envelope Border

This is a Retro Airmail Envelope Border. It wraps a container with continuous diagonal red and blue stripes. Its function is to provide a nostalgic, thematic framing for content without relying on external raster image assets.

Technologies:
CSS
Difficulty: Beginner
Browser Support (as of Apr 2026):
Chrome Chrome 108+ Edge Edge 108+ Firefox Firefox 101+ Safari Safari 15.4+
Features:
Gradient Border CSS Variables Vintage Style
Code by: Rob O'Leary Rob O'Leary
License: MIT

See the Pen Retro Airmail Envelope Border.

A bright yellow button with an animated dashed border that draws itself around the perimeter on hover, along with corner dots that appear sequentially.

Animated Border Drawing Button

This is an Animated Border Drawing Button. It transforms a standard call-to-action into a multi-stage micro-interaction. Upon hovering over the button, the component triggers a sequential animation where four corner dots appear, followed by four dashed border lines that “draw” themselves around the button’s perimeter, creating a high-end, futuristic feel.

Technologies:
HTML CSS
Difficulty: Intermediate
Browser Support (as of Mar 2026):
Chrome Chrome 105+ Edge Edge 105+ Firefox Firefox 121+ Safari Safari 15.4+
Features:
Staggered Animation CSS :has() Pure CSS
Code by: dexter-st dexter-st
License: MIT

See the Pen Animated Border Drawing Button.

Two side-by-side images with a soft, blurred background created by stretching and blurring the original image using the CSS border-image property

Frameless Blurred Background Image Effect in CSS

This is a Frameless Blurred Background Image Effect. It uses an innovative CSS technique to generate a soft, atmospheric background for an image by duplicating, stretching, and blurring the image itself. The function is to create a polished, “pro” look for profile pictures or product thumbnails without requiring image editing software or complex JavaScript canvas manipulations.

Technologies:
HTML CSS
Difficulty: Intermediate
Browser Support (as of Mar 2026):
Chrome Chrome 15+ Edge Edge 12+ Firefox Firefox 15+ Safari Safari 6+
Features:
Border-image Trick CSS Custom Properties Pure CSS
Code by: Temani Afif Temani Afif
License: MIT
Interactive UI tool with sliders generating custom animated, slanted, and dashed CSS borders using background-image gradients

Dashed Gradient Border Generator

This is an Animated Gradient Border Generator. It bypasses standard CSS border limitations by utilizing stacked repeating-linear-gradient functions applied to the background-image. Its function is to provide developers with a visual interface to dial in specific parameters — slant, gap, fade, and velocity — while instantly outputting the required, mathematically precise CSS code.

Technologies:
HTML SCSS JavaScript
Difficulty: Advanced
Browser Support (as of Feb 2026):
Chrome Chrome 80+ Edge Edge 80+ Firefox Firefox 75+ Safari Safari 13.1+
Features:
Procedural Generation Trigonometric Logic Live Code Preview Animated Gradients
Code by: Amit Sheen Amit Sheen
License: MIT
Dark UI card with a glowing orange electric border effect using CSS and animated SVG feTurbulence

Animated Electric Border CSS Card

This is an Animated Electric Border CSS Card. It utilizes an embedded SVG filter to render a dynamic, unstable boundary. Its function is to isolate data and establish a clear focal point. The effect is self-contained and persistent, demanding attention through continuous motion.

Technologies:
HTML CSS
Difficulty: Intermediate
Browser Support (as of Feb 2026):
Chrome Chrome 111+ Edge Edge 111+ Firefox Firefox 113+ Safari Safari 15.4+
Features:
Turbulent Glow SVG Filter Multi-layer Setup CSS Variables
License: MIT
Grid of dark cards; the hovered card has a subtle glowing white border that follows the mouse cursor, created by CSS radial gradients

Stripe-Inspired Cards Hover Effect

This Stripe-Inspired Cards Hover Effect replicates the sophisticated “flashlight” border interaction seen on modern SaaS websites. Instead of a simple color change, a soft radial gradient follows the user’s mouse cursor across a grid of cards. This creates a cohesive, lighting-aware interface where elements seem to illuminate as you interact with them.

Technologies:
HTML SCSS JavaScript
Difficulty: Intermediate
Browser Support (as of Jan 2026):
Chrome Chrome 49+ Edge Edge 15+ Firefox Firefox 31+ Safari Safari 9.1+
Features:
Mouse Tracking CSS Variables Radial Gradient Mask Border Reveal
License: MIT
An image framed by a decorative, wavy border created with pure CSS masks and gradients.

Images Inside Wiggly Boxes

A decorative image frame created entirely with CSS mask compositing. It combines radial-gradient layers with conic-gradient and the intersect composite operator to sculpt a scalloped, wavy border, while the CSS round() function ensures perfect pattern alignment along the edges.

See the Pen Images Inside Wiggly Boxes.

A dark-themed employee profile grid with elegant gradient borders and glowing effects.

Modern Our Team Section

A stylish, modern employee profile grid on a dark background featuring subtle, elegant gradient borders and atmospheric glowing effects.

See the Pen Modern Our Team Section.

A gallery of images framed to look like interlocking jigsaw puzzle pieces.

Wavy Image Gallery

Images appear as jigsaw puzzle pieces with interlocking edges that can visually fit together.

See the Pen Wavy Image Gallery.

Art Deco Card

Art Deco Card

An elegant Art Deco style card created purely with CSS/SCSS, utilizing a sophisticated technique with pseudo-elements to construct complex, multi-layered geometric borders and corners.

See the Pen Art Deco Card.

Basic CSS Snippets: Double Borders

Basic CSS Snippets: Double Borders

This demo is a visual guide to creating double borders and frames using pure CSS. It showcases elegant and flexible approaches with box-shadow, outline, and CSS variables, making the code clean and easily customizable.

Animated Border Gradient Glow

Animated Border Gradient Glow

An animated rainbow border effect with a neon glow, implemented using @property, conic-gradient, and SVG filters. The @keyframes animation smoothly changes the --a CSS variable, which controls the hue in the conic-gradient, creating a continuous color transition.

See the Pen Animated Border Gradient Glow.

Partial Dashed Bottom Border

Partial Dashed Bottom Border

A stylish custom dashed underline built with repeating-linear-gradient as a background image for superior control. This snippet offers precise adjustment of dash lengths and gaps via SCSS variables.

See the Pen Partial Dashed Bottom Border.

Full Screen Vintage Frame with Multiple Borders

Full Screen Vintage Frame with Multiple Borders

This responsive layout constructs an ornate vintage frame around text using nested concentric borders. The .outer-border, .mid-border, and .inner-border rules stack thin and thick rules with custom paddings. Decorative corner and edge images are placed using position: absolute and flipped using simple scale() transforms.

Cool img Borders With Background

Cool img Borders With Background

A sophisticated CSS masonry grid featuring mathematically-generated borders and patterns powered by SCSS. This snippet showcases the use of conic and radial gradients to render intricate shapes like stars and hearts within the border-box.

Cross-browser Offset Gradient Border From Image Source

Cross-browser Offset Gradient Border From Image Source

A sophisticated CSS image gallery featuring blurred glassmorphism borders achieved through backdrop-filter and advanced CSS masking. This snippet utilizes border-image with dynamic source URLs and mask-composite: exclude to isolate the blur effect to the border area.

CSS-only Wavy Borders

CSS-only Wavy Borders

A sophisticated CSS wavy border effect powered by advanced masking and modern math functions like round() and sqrt(). This performance-driven snippet utilizes conic-gradient to create scalable decorative frames.

See the Pen CSS-only Wavy Borders.

CSS Only Infinite Borders

CSS Only Infinite Borders

This snippet generates multiple concentric circular borders around images using a single CSS element. The layout calculates padding and gradient offsets mathematically using variables. An intricate repeating-radial-gradient is applied via border-image to loop color and transparent rings, while clip-path keeps the corners rounded.

See the Pen CSS Only Infinite Borders.

Stamp Border

Stamp Border

This stylesheet crafts a realistic postage stamp perforated border using nested CSS background gradients. By layering a tiled radial-gradient of transparent circles over a shrunken, solid white linear-gradient, the circles act as edge cutouts. The background-repeat: round rule ensures a seamless fit of scallops on any viewport size.

See the Pen Stamp Border.

Untitled

Untitled

This stylesheet crafts a sci-fi, angled gaming HUD frame around an image using @layer rules and advanced CSS masking. By combining a layered ::before pseudo-element with clip-path: polygon(), it carves matching chamfered corner cuts. Calculating inset coordinates on the image reveals a clean, thick border outline and a styled title tag.

See the Pen Untitled.

Native Rounded Outline

Native Rounded Outline

This typography layout renders a continuous line-by-line outline frame around multi-line text. By configuring the paragraph block as display: inline, the text flows naturally. Applying a solid outline with an outline-offset and border-radius directly onto the inline elements wraps each line fragment in a rounded bubble.

See the Pen Native Rounded Outline.

Travel Website With Inverted border-radius

This clean dashboard grid styles three-column tour cards with custom tabs. The standout design detail is the inverted rounded corners on the .more and .tag labels. These corner notches are built using absolute-positioned pseudo-elements styled with a transparent fill, a border-radius, and a thick solid white box-shadow mask.

Gradient Border

Gradient Border

This clean chess dashboard layout arranges text columns with fading vertical dividers using flexbox. By utilizing border-image with a linear gradient, the borders seamlessly fade in from the dark background color (#181818) at the top, peak in brightness at the center, and fade back to the body color at the bottom.

See the Pen Gradient Border.

Multiple Border-Radius Values

Multiple Border-Radius Values

This interactive card demonstrates the advanced 8-value elliptical border-radius syntax in CSS. By defining separate horizontal and vertical radius values for each corner (such as 37px 140px), the container gets an organic, hand-drawn, sketch-like silhouette. Upon hover, the skewed card tilts dynamically alongside its labels.

See the Pen Multiple Border-Radius Values.

Offset and XOR Frame: Lively

Offset and XOR Frame: Lively

This stylesheet demonstrates a complex geometrical layout built using overlapping blocks and CSS blend modes. The article elements leverage asymmetrical transparent borders and inset box-shadows. By applying mix-blend-mode: difference on the :before pseudo-elements, the intersecting segments render contrasting, hollow outlines.

See the Pen Offset and XOR Frame: Lively.

8-bit Pixel Border

8-bit Pixel Border

This clean stylesheet styles an interlocking, geometric box frame using absolute-positioned border elements. The top, bottom, left, and right lines are offset outward from the main .box. Tiny 8px square pseudo-elements (::before and ::after) are placed on the horizontal bar tips to mimic a wooden joints mortise-and-tenon look.

See the Pen 8-bit Pixel Border.

8bit border-image

8bit border-image

This stylesheet implements a retro, pixelated border and pointer arrow using zero-request inline vector graphics. By using URL-encoded SVGs inside border-image and background-image declarations, it draws a scalable double-outline frame and custom pointer. This approach scales cleanly without triggering additional HTTP network requests.

See the Pen 8bit border-image.

Avatar Border Effect. 15 Declarations, 1 Element, No Pseudos

Avatar Border Effect. 15 Declarations, 1 Element, No Pseudos

This stylesheet crafts a segmented circular border with rounded junctions using pure CSS math and masking. It positions radial-gradient dots at exact quadrant joints (0deg, 90deg, etc.) using trigonometric cos() and sin() functions. An advanced mask with a subtract composite punches out the center, leaving only the outer ring.

Border Linear-Gradient + Border-Radius

Border Linear-Gradient + Border-Radius

This stylesheet styles a clean, layered card layout featuring glowing offset borders and deep shadows. The parent .item uses an absolute-positioned :before layer, scaled slightly larger and filled with an angled pink gradient to mimic a glowing edge. The nested .inner card anchors the design with a soft-focus #FBE4E0 shadow.

Frequently Asked Questions

What is the performance difference between border-image, outline, and box-shadow for decorative borders?

outline and box-shadow render on the compositor thread and do not affect the element’s box model, making them repaint-free during animations. border-image creates a bitmap snapshot that can trigger repaints when the element resizes, so prefer outline with outline-offset for hover-state decorative borders.

How do I create a gradient border without extra pseudo-elements?

Use border-image-source: linear-gradient() or conic-gradient() with border-image-slice: 1. This technique renders the gradient directly as the border surface without requiring additional markup or pseudo-elements, keeping the DOM minimal.

How should border styles handle focus indicators for accessibility?

Always define :focus-visible with a high-contrast outline that is independent of decorative borders. Use outline-offset to separate the focus ring from decorative gradient borders, ensuring focus visibility passes WCAG SC 2.4.13.

How do I make border widths responsive across viewports?

Set border-width and outline-width using clamp() with viewport-relative minimum and maximum values. For gradient borders via border-image, wrap the thickness in CSS Custom Properties adjusted by Container Queries.

What fallback works for browsers that don’t support border-image-source for gradient borders?

Declare a solid border with the desired width and color as the base, then override it with the gradient border-image-source inside a @supports (border-image-source: linear-gradient(red, blue)) rule. Legacy browsers display the solid color while modern browsers render the gradient border.