How to Change the Design of a Webflow Lightbox?

Tutorial
3 min
Published on Mar 20, 2023
Updated on
Preview of an embedded HTML code on Webflow with a modification of the CSS class of a lightbox.
Use AI to summarize this article
Key points

‍Lightboxes in Webflow are very convenient, but it is "impossible" to customize their designs natively. In this tutorial, discover how to change the default design of a lightbox in Webflow using a bit of CSS code.

For this tutorial, we will modify the overlay used as the background color, changing it from a transparent black to a white background with a blur effect.

Customize a Lightbox in Just a Few Steps

1. Find the class you want to modify

To easily identify the CSS class you want to change;

  1. Open your lightbox on a published Webflow project (online, even on a webflow.io version)
  2. Open your browser's "inspect" option (cmd + option + I on Mac)
  3. Find the name of the targeted CSS class
Inspecting CSS code of a Webflow site on Google Chrome

2. Add an embed code

Add (as high as possible) an Embed Code element in your navigator

Adding an Embed Code element on Webflow

3. Define new CSS styles for the targeted Lightbox CSS class

Then, integrate the new styles you want to apply to your lightbox in this embed code for Webflow. For this example, we want to change the background color of the lightbox, so we will modify the values assigned to the CSS class  .w-lightbox-backdrop (created by default by Webflow).

Example code:

<style>
.w-lightbox-backdrop {
  background: rgba(0,0,0,0.1) !important;
  backdrop-filter: blur(10px);
}
</style>
Changing the background color and adding a CSS blur effect
Changing the background color and adding a blur effect

⚠️ To ensure that the values are prioritized and recognized by the browsers, it is important to add the "!important;" declaration at the end of your CSS styles. This "forces" the application of these CSS settings for your Webflow lightbox.

Florian Bodelot
Florian Bodelot
Co-founder

Suggested articles

Webflow vs. custom development with a headless CMS, illustrated by the Webflow Designer and a code editor.
Documentation
Development

Webflow vs. Custom Development (Next.js, Astro): 6 questions to make the right choice

Webflow vs. Custom Development (Next.js, Astro): 6 questions to make the right choice
PHP2Shell visual: CVE-2026-109618 and CVE-2026-109619 rated 9.2, terminal of a WordPress server on PHP 8.1 with no patch, Webflow site not affected
News
Webflow

PHP2Shell critical PHP vulnerability: what to do about your WordPress site, and should you move to Webflow?

PHP2Shell critical PHP vulnerability: what to do about your WordPress site, and should you move to Webflow?
AI video generation workflow combining images, AI models, audio and video editing
Documentation
AI

5 AI tools to watch this year for video generation

5 AI tools to watch this year for video generation
Every great website  
starts with a conversation
Abstract composition of black and gold metallic ribbons with elegant light reflections and smooth gradients. A premium background conveying luxury, modernity, and innovation.