CSS box-reflect Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Visual Effects

What You’ll Learn

The box-reflect property creates a mirror-like reflection of an element. It is a WebKit-only visual effect — useful for decorative layouts, but not a standard CSS feature you should depend on everywhere.

01

Reflections

Mirror an element visually.

02

Syntax

Direction, offset, mask.

03

Directions

above, below, left, right.

04

Gradient Mask

Fade reflections smoothly.

05

WebKit Prefix

Use -webkit-box-reflect.

06

Fallbacks

Design without reflections.

Definition and Usage

The box-reflect CSS property lets you create a reflection of an element, similar to a mirror image. In practice, you write it as the vendor-prefixed property -webkit-box-reflect because there is no widely supported standard version.

This property is primarily supported in WebKit-based browsers such as Safari and some Chromium builds. It can create visually appealing effects by reflecting the content of an element — images, cards, logos, and headings are common targets.

💡
Beginner Tip

Treat reflections as optional decoration. Your layout and content should still look complete in browsers that ignore -webkit-box-reflect.

📝 Syntax

The syntax for box-reflect includes a direction, an optional offset, and an optional mask:

syntax.css
selector {
  -webkit-box-reflect: direction offset mask;
}

Basic Example

box-reflect.css
.reflect {
  -webkit-box-reflect: below 10px;
}

Syntax Rules

  • Always use the -webkit- prefix — there is no reliable unprefixed version.
  • Direction is required: above, below, left, or right.
  • Offset is optional spacing between the element and its reflection (e.g. 10px).
  • Mask is optional — usually a gradient that fades the reflection out.
  • There is no default reflection; you must set the property explicitly on each element.

⚡ Quick Reference

QuestionAnswer
Standard property?No — WebKit vendor feature
Property name in CSS-webkit-box-reflect
Default valueNone (no reflection unless set)
InheritedNo
Common useDecorative image, logo, and card reflections

💎 Property Values

The -webkit-box-reflect value is made up of three parts: direction, offset, and an optional mask.

PartExampleMeaning
directionbelowPlaces the reflection below the element. Also: above, left, right.
offset10pxGap between the element and its reflection. Accepts any valid CSS length.
masklinear-gradient(transparent, white)Optional gradient or image that fades or shapes the reflection.
above below left right
0px 10px 1em

Reflection Directions

The direction keyword controls where the mirrored copy appears relative to the original element:

  • below — Most common. The reflection appears under the element, like a floor mirror.
  • above — The reflection appears above the element.
  • left — The reflection appears to the left side.
  • right — The reflection appears to the right side.

Combine a direction with an offset to add breathing room between the element and its reflection. Add a gradient mask to fade the reflection smoothly instead of showing a hard mirrored edge.

👀 Live Preview

This card uses -webkit-box-reflect: below 8px with a gradient mask. The effect appears in supporting WebKit browsers.

Reflect me

If you do not see a reflection, your browser may not support -webkit-box-reflect. The card above still displays normally — that is expected fallback behavior.

Examples Gallery

Try basic reflections, gradient masks, different directions, and card-style effects.

🖼 Basic Reflections

Start with a simple below reflection and a small offset — the same pattern from the reference example.

Example 1 — Image Reflection Below

Create a reflection of an image below the element with a 10px offset.

image-reflect.html
<style>
  .reflect {
    -webkit-box-reflect: below 10px;
  }
</style>

<img src="photo.jpg" alt="Example" class="reflect">
Try It Yourself

How It Works

The browser draws a vertically flipped copy of the element 10px below the original. No JavaScript or extra HTML is required.

🎨 Gradient Masks

A gradient mask fades the reflection so it looks more natural, like a glossy surface fading into the background.

Example 2 — Reflection with Gradient Mask

Use a linear gradient to fade the reflection from visible to transparent.

reflect-mask.html
<style>
  .fade-reflect {
    -webkit-box-reflect: below 4px linear-gradient(transparent 30%, rgba(255,255,255,0.4));
  }
</style>

<div class="fade-reflect logo">Logo</div>
Try It Yourself

How It Works

The gradient mask controls opacity across the reflection. The top of the reflection stays subtle, then it fades out — a common technique for logo and cover-flow-style effects.

Example 3 — Reflection Above the Element

Change the direction keyword to place the mirror image on the other side.

reflect-above.html
<style>
  .reflect-above {
    -webkit-box-reflect: above 6px linear-gradient(transparent, rgba(0,0,0,0.25));
  }
</style>

<h2 class="reflect-above">Featured Title</h2>
Try It Yourself

How It Works

Replacing below with above mirrors the element upward. Leave extra padding around the element so the reflection has room to display.

📱 UI & Cards

Reflections work on any replaced or block content — cards, icons, and product thumbnails are popular choices.

Example 4 — Product Card Reflection

Apply a subtle reflection to a card for a polished showcase layout.

card-reflect.html
<style>
  .product-card {
    width: 10rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    -webkit-box-reflect: below 12px linear-gradient(transparent 50%, rgba(255,255,255,0.2));
  }
</style>

<article class="product-card">
  <h3>Headphones</h3>
  <p>$99</p>
</article>
Try It Yourself

How It Works

The card’s shadow, border-radius, and content are all reflected together. The gradient mask keeps the effect subtle so the layout still feels professional.

Fallback Strategy

Because -webkit-box-reflect is not widely supported, plan your design so it works without reflections:

  • Keep content readable — Do not place important text only in the reflection area.
  • Add bottom spacing carefully — Reflections extend the visual footprint; unsupported browsers will not need that extra space.
  • Use as enhancement — The element should look complete with or without the mirror effect.
  • Consider alternatives — For broader support, duplicate content with transform: scaleY(-1) and opacity in supporting layouts, or use SVG filters.

🧠 How box-reflect Works

1

You style an element normally

The original element renders with its usual background, border, image, or text content.

Base element
2

You add -webkit-box-reflect

Set a direction, optional offset, and optional gradient mask to control the mirrored copy.

CSS rule
3

WebKit draws the reflection

Supporting browsers flip the element’s appearance and place it on the chosen side, applying the mask if provided.

Rendering
=

Mirror-like visual effect

A decorative reflection appears in supporting browsers; other browsers show only the original element.

Limited Browser Support

The box-reflect property is non-standard and only supported in WebKit-based browsers such as Safari and some Chromium builds. It is not supported in Firefox or Edge. Use it with caution and always provide fallback styles.

Non-standard · WebKit only

Decorative effect — not a baseline CSS feature

Treat -webkit-box-reflect as progressive enhancement. Test your design in browsers that do not support it to ensure the page still works well.

38% WebKit browser support
Apple Safari 4+ · macOS & iOS
Supported
Google Chrome 4+ · WebKit engine era
Partial / legacy
Mozilla Firefox All versions
Not supported
Microsoft Edge Chromium & Legacy
Not supported
Opera Modern versions
Not supported

Fallback behavior

When unsupported, the element renders normally with no reflection — which is the correct graceful degradation.

💻
All unsupported browsers Reflection ignored · Original element unchanged
Safe
box-reflect property 38% supported

Bottom line: Use -webkit-box-reflect only for optional decoration. Never make reflections essential to your layout or content.

Conclusion

The box-reflect property can add a unique visual effect to your web elements by creating mirror-like reflections. However, due to its limited browser support, it should be used sparingly and with appropriate fallbacks.

Experiment with different directions, offsets, and gradient masks to achieve the desired effect. Always verify that your design still looks good when the reflection is not rendered.

💡 Best Practices

✅ Do

  • Use -webkit-box-reflect for optional decorative polish
  • Add a gradient mask to fade reflections naturally
  • Leave space around elements for the reflection to display
  • Test in Safari and in browsers without support
  • Keep the original element fully readable on its own

❌ Don’t

  • Rely on reflections for critical UI or information
  • Assume Chrome or Edge will always show the effect
  • Forget that this is a non-standard property
  • Use heavy reflections on long text blocks — it reduces readability
  • Skip fallback testing before shipping to production

Key Takeaways

Knowledge Unlocked

Five things to remember about box-reflect

Use these points before adding mirror effects to your pages.

5
Core concepts
02

Non-Standard

WebKit vendor feature.

Status
🗼 03

Direction

above, below, left, right.

Syntax
🎨 04

Gradient Mask

Fades the reflection.

Effect
🛡 05

Fallback First

Design without it.

Safety

❓ Frequently Asked Questions

box-reflect creates a mirror-like reflection of an element. It is implemented as the vendor-prefixed property -webkit-box-reflect and draws a flipped copy of the element in a chosen direction.
No. box-reflect is a non-standard WebKit feature. There is no unprefixed standard version in the CSS specification, so you should treat it as progressive enhancement only.
It works in WebKit-based browsers such as Safari and some Chromium builds. Firefox and most non-WebKit browsers do not support it, so always provide a fallback design.
The syntax is direction, optional offset, and optional mask. Direction can be above, below, left, or right. Offset is a length like 10px. Mask is usually a gradient that fades the reflection.
Use it sparingly for decorative effects where missing reflections will not break the layout. Never rely on reflections to communicate important information, and test without the effect to ensure the page still looks good.

Practice in the Live Editor

Open the HTML editor, apply -webkit-box-reflect, and preview mirror effects instantly.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful