Envira Gallery CSS - WordPress Plugin
Place your own custom CSS into each individual gallery with the CSS addon, giving you endless possibilities for your gallery style and display views.

Plugin Features
The plugin is an add-on for Envira Gallery that enhances its styling capabilities. By integrating this plugin, users can elevate the visual appeal of their galleries with custom CSS styles. It offers a seamless way to modify the appearance of galleries within Envira Gallery, providing flexibility and customization options to meet different design needs effortlessly.
With its advanced features, users can easily fine-tune the look and feel of their galleries, making them more visually striking and aligning them with their desired aesthetics. The plugin equips users with the tools to create unique gallery layouts and designs, allowing for a personalized touch that sets their galleries apart. Its intuitive interface ensures a user-friendly experience, enabling both novice and experienced users to customize their galleries effectively.
This plugin streamlines the process of applying CSS styles to Envira Gallery, eliminating the need for manual coding and technical expertise. Users can leverage its functionality to achieve professional-grade styling results without delving into complex code. It simplifies the customization process, making it accessible to a wider range of users who seek to enhance the visual presentation of their galleries easily.
By utilizing this plugin, users can experiment with various design elements, such as colors, fonts, spacing, and more, to create visually stunning galleries that resonate with their audience. Its versatility and adaptability empower users to unleash their creativity and design galleries that encapsulate their unique brand identity or creative vision effectively. The plugin serves as a valuable tool for anyone looking to elevate their gallery displays and create captivating visual experiences for their website visitors.
In conclusion, Envira Gallery CSS offers a seamless solution for implementing custom CSS styles within Envira Gallery, providing users with a powerful tool to transform their galleries into visually engaging assets. Its user-friendly interface, advanced features, and flexibility make it a go-to choice for individuals and businesses aiming to enhance the visual appeal of their galleries with ease. Whether creating portfolios, product showcases, or image galleries, this plugin offers a reliable means to achieve tailored and visually striking results effortlessly.
Specifications:
| Release date: | 11-05-2019 | |
| Last updated: | 28-07-2026 | |
| Type: | Paid | |
| License: | GPL | |
| Subject: | Style & Design for Envira Gallery | |
| Compatibility: | W5.x W6.x | |
| Includes: | Plugin | |
| Language packs: |
|
|
| Developer: | Envira Gallery | |
| Rating: | ||
Share with your friends!
How to Configure Envira Gallery CSS for Precise Gallery Styling
Envira Gallery CSS is not meant for building a gallery from scratch. It is meant for fine-tuning galleries you have already created in Envira Gallery. In this guide, we will cover where to enable the CSS Addon, how to find the code field, why it matters to tie styles to a specific gallery ID, how to verify the result on the live page, and what to do if a change does not appear after you save it.
This article is written for a site owner, content manager, or developer who already understands what the gallery is supposed to do: showcase a portfolio, a selection of work, an image catalog, a photo report, or a visual block on a landing page. It is not a general overview of Envira Gallery as a plugin. Instead, we will focus on a practical task: how to change the look of one specific gallery without editing the theme and without affecting other galleries on the site.
Along the way, you will see safe CSS approaches, result-checking steps, common troubleshooting paths, and cases where it makes more sense to use theme-wide styles, built-in gallery settings, or a different gallery plugin instead of the CSS Addon. The images in this article are instructional diagrams and interface reconstructions based on the official documentation, not direct screenshots.
What the CSS Addon Actually Changes and Where Its Limits Are
The CSS Addon gives Envira Gallery the ability to store custom CSS for an individual gallery. The official documentation describes this as a gallery-level setting: you open the gallery, go to the Misc tab, and add CSS in the Custom Gallery CSS field. After you publish or update the gallery, those styles are applied to that gallery on the site.
This is different from standard settings for columns, spacing, image size, captions, lightbox, and mobile display. Envira Gallery's built-in options are usually the better place to adjust those basics because they are stored as plugin settings and are easy for an editor to understand without code. The CSS Addon becomes useful when the standard settings are not enough: you need to slightly change a border, hover effect, caption position, spacing around one gallery, or the appearance of an element Envira already outputs.
The boundary is simple: CSS changes the appearance of existing elements, but it does not add new business logic. It does not create filters, change image loading order, connect third-party services, or replace Envira Gallery settings that control gallery structure. If you need to change which images appear in the gallery, how pagination works, or how lightbox is enabled, that belongs in Envira settings or in the appropriate addon. If you only need to visually refine an existing output, the CSS Addon is the better fit.
Why Per-Gallery CSS Is Safer Than Global Edits
The main idea behind the CSS Addon is to limit the scope of your styles. Envira's documentation emphasizes that CSS should be prefixed with a selector like #envira-gallery-xx, where xx is replaced with the gallery's internal ID. That approach helps you avoid affecting other galleries that may use a different layout, a different number of columns, or serve a different purpose.
Imagine a photographer's website: the homepage has a compact six-image selection, the portfolio section uses a large masonry gallery, and the testimonials section includes a small grid of case-study visuals. If you write one generic style for all Envira elements, you can easily break a gallery that is supposed to look different. If the CSS is tied to one specific gallery ID, the change stays local.
When You Do Not Need the CSS Addon
Sometimes users try to solve something with CSS that Envira Gallery already handles in the interface. That makes the site harder to maintain: the next editor opens the gallery settings, sees normal values, and has no idea why the front-end looks different. It is better to check the built-in settings first.
- The number of columns, spacing between images, and the basic thumbnail size are usually better adjusted in the gallery settings.
- Enabling lightbox, captions, titles, metadata, and image behavior belongs to Envira Gallery settings, not CSS.
- A shared style for every gallery on the site is usually easier to maintain in
Appearance-Customize-Additional CSSor in the theme styles if the task is truly global. - Complex logic, such as changing URLs, integrating WooCommerce, or handling data in other ways, should not be faked with CSS.
Practical rule: if the change answers the question "how does the element look," the CSS Addon may be appropriate. If it answers the question "what does the element do," look first for an Envira Gallery setting, a separate addon, or a documented hook.
Who Envira Gallery CSS Is Best For and When Another Approach Makes More Sense
Envira Gallery CSS is a strong fit for sites where the gallery's visual presentation needs to match the brand style, but you do not want to edit theme files. A typical use case is a designer portfolio, photo studio, architecture firm, real estate agency, online magazine, or product page where one specific gallery needs to look slightly different from the rest of the site.
The plugin is also useful for a developer maintaining a client site. Instead of adding a large global CSS block to the theme, they can keep a local snippet inside the gallery itself. A month later, it is much easier to understand why that one gallery has custom borders, spacing, or hover effects. This approach is especially convenient when the gallery is used on multiple pages: you update one Envira Gallery object, and the result changes everywhere it is embedded.
Good Fit
- You need to make a targeted visual change to one gallery or one album.
- The site has multiple galleries, and each one serves a different visual purpose.
- The editor already knows how to create Envira galleries but wants more precise design control without editing theme files.
- The developer wants to keep a short, safe, reversible CSS snippet next to the gallery settings.
- The theme or page builder adds its own styles, and you need to refine a specific Envira output carefully.
May Not Be the Right Fit
If the site needs a completely new gallery type, dynamic filtering, user image uploads, or a complex sales-oriented showcase, the CSS Addon alone will not solve the problem. It can improve the visual presentation, but it will not replace Envira Gallery's functional addons or turn a standard gallery into a separate application.
You should also be more cautious on sites managed by multiple editors without technical oversight. CSS is easy to break with one missing brace or the wrong selector. In that situation, it is better to limit access to the CSS field and keep a short internal note explaining what each snippet changes.
What to Check Before Installing and Enabling the Addon
Before you configure the CSS Addon, make sure the basic Envira Gallery workflow is already working. This saves time: if the gallery has not been created, published, or inserted into a page, there is no reliable way to confirm whether the CSS is being applied. Envira's official documentation covers installing Envira Gallery, activating addons, and creating the first gallery, so here we will focus on a practical pre-launch checklist.
Environment Check
The CSS Addon documentation lists the requirements: an active Envira Gallery installation, a qualifying Pro-level license or higher, WordPress, and an Envira Gallery version that meets the minimum stated in the official article. You should not hard-code dates into a published guide, but before starting, the site administrator should verify the current requirements on the documentation page, especially if the site has not been updated in a while.
- Open the WordPress admin panel and confirm that Envira Gallery is active.
- Check that the target gallery already exists and contains real images, not an empty draft.
- Make sure the addon is installed and activated through
Envira Gallery-Addons. - Confirm that the page containing the gallery is published or available in preview mode.
- If the site uses caching, identify in advance where to clear the site cache, the optimization plugin cache, and the Envira Gallery cache.
Permissions Check
The CSS Addon affects the public-facing design of the site. For that reason, permission to edit those fields should usually be limited to administrators or trusted editors. If many authors work on the site, the CSS field should not become a space for experiments. A selector mistake may be harmless, but a missing closing brace can break several rules below it.
For team workflows, it helps to keep a short internal note: which gallery was changed, why the CSS was added, where to verify the result, and how to roll it back. That is not bureaucracy. It is protection against the very common situation where, a few months later, nobody remembers why the portfolio page has a non-standard effect.
Installation and the First Check After Activation
Installing the CSS Addon usually follows the same path as other Envira Gallery addons. In the WordPress admin panel, open Envira Gallery - Addons, find the addon you need, click Install, and then Activate. If the addon is already installed, activation alone is enough. Manual installation from a file is possible, but for routine work, the standard addons screen is more convenient.
After activation, do not jump straight into writing a large CSS block. First, confirm that the correct field appears in the gallery editor. Open an existing gallery, go to its settings, and find the Misc tab. In Envira's documentation, the field is called Custom Gallery CSS; in the same area, you may also see a field for classes. Those are different things, and they should not be confused.
Custom Gallery CSS field, not the classes field.A Minimal No-Risk Test
For the first test, use a visible but reversible rule. For example, you can temporarily add outer spacing around one specific gallery. The main thing is to replace the number in the selector with your gallery's actual ID. You can find the ID in the Envira Code block on the gallery edit screen, and also in the shortcode.
#envira-gallery-123456 {
margin: 40px 0;
}
Save the gallery with Publish or Update, then open the page containing that gallery in a new tab. If the spacing appears, the full chain is working: addon - CSS field - save action - front-end output. After the test, you can replace the rule with real styling or delete it if it was only used to verify the setup.
If the Addon Does Not Appear
Envira's official addon documentation describes a common reason: sometimes the addons screen or available packages do not refresh properly because of cache. In that case, first use Envira's built-in tools: go to Envira Gallery - Tools, then clear the Envira cache and transients. After that, reload the addons page. If the addon card still does not appear, do not assume the product "does not work." First, check the license, the Envira Gallery version, and the addon availability in the official documentation.
Detailed Setup: From Gallery ID to Safe CSS
Configuring Envira Gallery CSS does not start with writing code. It starts with choosing the correct scope. The most common reason CSS changes fail in WordPress is always the same: the selector is too broad. It ends up affecting not only the target gallery, but also theme blocks, blog galleries, or page builder elements. That is why the right order is: lock in the ID, write a small rule, then verify the result.
How to Find the Right ID
On the Envira gallery edit screen, there is an Envira Code block. It usually shows a shortcode, a link, or another embed code. The number inside the shortcode is the ID you need for local CSS. The official documentation for finding the ID shows an example selector like #envira-gallery-436798. Your number will be different.
Use that ID as the first level of your selector. Do not start a rule with a generic class like .envira-gallery-image unless you actually want to affect every gallery. A better pattern is to start with the specific gallery container and then target the internal element you need.
#envira-gallery-123456 .envira-gallery-image {
border: 4px solid #222;
}
This rule adds a border only to images inside one gallery. If you create a second gallery tomorrow with a different ID, it will not inherit that border by accident.
Where to Put the CSS: Gallery Field or Global Styles
With Envira, there are two sensible places for CSS. The first is the Custom Gallery CSS field inside a specific gallery. The second is global Additional CSS in WordPress settings or the child theme styles. The official CSS Addon is especially useful for the first option, when the change should live alongside the gallery itself.
| Task | Best Place | Why |
|---|---|---|
| One gallery needs to look different from the others | Custom Gallery CSS |
The rule stays attached to that specific gallery and is easier to track. |
| All galleries on the site should have the same border or spacing |
Additional CSS or a child theme |
You do not have to repeat the same global style inside every gallery. |
| You need to change lightbox, pagination, or loading behavior | Envira settings or a separate addon | CSS should not stand in for functional settings. |
| You want to test a visual idea temporarily | Custom Gallery CSS |
The snippet is easy to remove without editing theme files. |
If you are unsure, start with the local option. Once the rule proves useful and needs to be applied to all galleries, move it to a global location and replace the ID selector with a broader one, but only after testing it on multiple pages.
Which Settings to Test First
For a typical site, it makes sense to start with spacing, borders, a subtle hover effect, and captions. These changes do not interfere with the gallery data and are easy to roll back. Do not start with aggressive rules such as fully hiding elements or forcing the width of every image. Those edits often conflict with responsive layouts, especially if the gallery is already configured for multiple screen sizes.
Spacing Around the Gallery
Spacing helps separate the gallery from the surrounding page content. It is a safe first edit because it affects the container as a whole without changing the internal grid.
#envira-gallery-123456 {
margin: 36px 0;
}
Image Borders
A border works well for portfolios where images have different backgrounds and tend to blend into a white page. Check the result on mobile: a thick border can make thumbnails feel visually smaller.
#envira-gallery-123456 .envira-gallery-image {
border: 3px solid #1f2933;
box-sizing: border-box;
}
A Gentle Hover Effect
A hover effect helps signal that an image is clickable. It should be short and restrained. If the zoom is too strong, it may crop the image or disrupt the neatness of the grid.
#envira-gallery-123456 .envira-gallery-item img {
transition: transform 0.2s ease, opacity 0.2s ease;
}
#envira-gallery-123456 .envira-gallery-item:hover img {
transform: scale(1.03);
opacity: 0.92;
}
After saving, check three states: the default view, mouse hover, and the opened image. If the gallery uses lightbox, the CSS should not interfere with the click action or cover navigation elements.
Practical Example: Styling a Portfolio Without Affecting Other Galleries
Let us walk through a realistic scenario. A photography studio site has a page called "Portfolio" that needs a clean grid: more breathing room between items, a thin border around the images, and a slight darkening effect on hover. The same site also has a "Client Testimonials" gallery that should not be touched. That is why global CSS is not the right choice here. We will use Envira Gallery CSS only for the portfolio gallery.
Goal
Create a gallery with a clean visual accent that feels like part of the site's brand style, without changing other Envira galleries. The result should be visible on the published page, and rolling it back should take less than a minute.
Preparation
- The portfolio gallery has already been created in Envira Gallery and contains the final images.
- The gallery has been inserted into the page through an Envira block, shortcode, or another standard method.
- The CSS Addon is active, and the
Custom Gallery CSSfield is available in the gallery editor. - The gallery ID has been found in the
Envira Codeblock. This example uses123456, but your site will use a different number.
Steps
- Open the target gallery in the WordPress admin panel.
- Go to the
Misctab. - Paste the CSS into the
Custom Gallery CSSfield, replacing123456with your actual gallery ID. - Click
UpdateorPublish. - Open the page with the gallery in a new tab and review the appearance.
#envira-gallery-123456 {
margin: 42px 0;
}
#envira-gallery-123456 .envira-gallery-image {
border: 2px solid #202733;
box-sizing: border-box;
}
#envira-gallery-123456 .envira-gallery-item img {
transition: transform 0.2s ease, opacity 0.2s ease;
}
#envira-gallery-123456 .envira-gallery-item:hover img {
transform: scale(1.03);
opacity: 0.9;
}
Verification
Do not check only the portfolio page. Open any other page that uses Envira Gallery and make sure it did not inherit the border or hover effect. If another gallery changed too, your selector is too broad or the code includes a generic fragment without the gallery ID.
Quick takeaway: a successful setup is visible in one gallery, does not affect neighboring galleries, does not break image opening, and can be removed easily from the
Custom Gallery CSSfield.
One Important Detail
If the same gallery is inserted into a page more than once, it will change everywhere that same Envira Gallery object is used. That is expected behavior. The CSS is tied to the gallery itself, not to a specific page. If one page needs one design and another page needs a different design, create a separate gallery or use a more precise contextual selector in global styles, after confirming that it does not conflict with the theme.
How CSS Interacts With the Block, Shortcode, Theme, and Cache
Envira Gallery can be inserted into WordPress in several ways: through a block in the editor, a shortcode, the gallery button in the Classic Editor, or code in a template. For the CSS Addon, the insertion method is not the important part. What matters is which Envira Gallery object is being rendered on the page. If it is the same gallery with the same ID, its local CSS should apply no matter how it was inserted.
Envira Block and Shortcode
The Gutenberg documentation shows two helpful scenarios: you can insert an existing gallery through the Envira block, or create a gallery directly from the page editor and then open advanced editing. For CSS customization, it is usually easier to get the gallery working properly inside Envira first and then insert it into the page. That makes it easier to find the ID and verify that the code belongs to the correct object.
Shortcode is useful if you are working with the Classic Editor, a widget, or the Shortcode block. Even then, it is better to tie the CSS to the gallery ID, not to the shortcode location. Otherwise, you end up with a page-dependent style and make gallery reuse more complicated.
Theme and Page Builder
A WordPress theme and a page builder can add their own spacing, container widths, image styles, and hover effects. Because of that, the CSS Addon may sometimes fail to "win" visually even though it is technically loading. When that happens, do not rush to add !important to everything. First, use your browser's developer tools to see which rule is overriding your CSS.
If the conflict comes from the theme, it is better to refine the selector than to increase specificity everywhere. For example, add the gallery ID plus the inner element class. If the conflict comes from a page builder container, it may be more appropriate to adjust the builder section settings instead: width, inner spacing, or alignment. The CSS Addon should refine the gallery, not fight the entire page.
Cache and Optimization
Envira's official documentation mentions clearing the Envira cache and transients as a way to solve problems with addons and invisible changes. In real-world use, that often also includes the WordPress cache, optimization plugin cache, CDN cache, and browser cache. If a change is not visible, go in order: update the gallery, clear the Envira cache, clear the site cache, then open the page in a private window.
Do not change the CSS randomly after every failed check. If the code is saved but the page still shows the old version, the problem may be in the cache layer rather than in the CSS itself. In that situation, constant edits only make troubleshooting harder.
Practical Ideas for Different Gallery Types
The CSS Addon is especially useful when a gallery serves a specific role on the site. These are not generic "pretty effects," but real use cases where local CSS helps solve a clear problem without changing every gallery.
Portfolio for a Specialist or Studio
For a portfolio, spacing, visual rhythm, and a clean hover effect usually matter most. If the images vary in color and background, a border or subtle shadow can help separate them from the page. The check is simple: visitors should immediately understand that the images are clickable, and the grid should not jump when hovered.
Photo Report or Media Section
In a media section, readability and fast browsing are often more important than decorative effects. Here, minimal CSS changes work best: extra spacing between the gallery and the text, a calm hover effect, and clear captions. Overactive animation only gets in the way when users are scanning a large number of images.
Visual Block on a Landing Page
On a landing page, the gallery may be part of a sales or product presentation flow. Local CSS lets you make it feel consistent with the other page sections: matching borders, corner rounding, accent color, or surrounding space. But it is still a bad idea to turn the gallery into a separate complex interface if that makes the page harder to load and maintain.
Albums and Related Collections
Envira's documentation says the same CSS approach is also available for albums through the Misc tab. That is useful when an album should look different from a single gallery, for example with more prominent cover images, different spacing, or a separate visual accent. This is where selector checks matter even more, because an album and a gallery may use similar elements but different containers.
How to Verify the Result on the Site
Verification is not just "do I see the border or not." With galleries, you also need to check the grid, click behavior, responsiveness, subjective speed, and the absence of side effects. A good review takes a few minutes, but it can save hours of post-publication fixes.
Check the Public-Facing Page
- Open the page with the gallery as a regular visitor, not only in preview mode.
- Check the spacing before and after the gallery: the new CSS should not glue the gallery to the text or the neighboring block.
- Hover over several images if you added a hover effect.
- Open an image in the lightbox, if enabled, and make sure the navigation buttons still work.
- Check the page on a narrow screen or in your browser's responsive mode.
- Open a second page with a different Envira gallery and confirm that it did not change accidentally.
Check the Admin Panel
Go back to the gallery editor and make sure the CSS snippet is stored specifically in the Custom Gallery CSS field. If you are leaving code for a client, add a short comment inside the CSS. The comment should explain the purpose, not replace documentation.
/* Local portfolio style: border and gentle hover */
#envira-gallery-123456 .envira-gallery-image {
border: 2px solid #202733;
}
This kind of comment is safe and helps the next administrator understand that the snippet is intentional. Rolling it back is just as simple: remove the CSS from the field, update the gallery, and clear the cache.
When Not to Add CSS and What to Do Instead
The CSS Addon gives you flexibility, but that does not mean every problem should be solved with code. The more local snippets are scattered across galleries, the harder the site becomes to maintain. In a well-run project, the CSS Addon is used selectively, not as a storage place for every visual decision.
If You Need a Consistent Design System
When every gallery on the site should look the same, it is better to move the rule into a global location: the theme styles, child theme, or Additional CSS. That way, the visual system is managed centrally. The CSS Addon can then be reserved for exceptions.
If the Problem Is in the Source Images
Blurry, undersized, or poorly cropped images cannot be fixed with CSS without sacrificing quality. Envira's documentation for creating the first gallery explicitly calls out image preparation and metadata. If the source is weak, replace the image first, adjust thumbnail size, check cropping, and only then think about CSS.
If You Need a New Functional Mode
Pagination, tags, albums, WooCommerce, image protection, external-source loading, and other advanced modes belong to Envira Gallery's feature set and addons. CSS can change how they look, but it should not pretend a feature exists when it is not enabled in settings. If you need new functionality, look for the appropriate addon or an alternative product.
Why the CSS Is Not Applying and How to Diagnose the Problem
Problems with Envira Gallery CSS are usually not caused by the addon installation itself. They are usually tied to the insertion point, the wrong ID, caching, or a theme conflict. Below is a practical symptom-based checklist.
The Change Is Not Visible at All
Symptom: the CSS is saved, but the gallery looks the same as before. Possible cause: the code was added to the wrong field, the gallery was not updated, cache is showing an old version, or the selector points to the wrong ID.
What to Check
- The field must be
Custom Gallery CSS, not the custom classes field. - The ID in the selector must match the gallery ID shown in
Envira Code. - After pasting the code, you need to click
UpdateorPublish. - If caching is enabled, clear the Envira cache, transients, and the site cache.
How to fix it: insert a simple test spacing rule, save it, clear the cache, and check the page in a private window. If the test spacing appears, go back to your real CSS. If it does not, verify the ID and the insertion location.
More Than the Intended Gallery Changed
Symptom: the border, spacing, or hover effect appears in several galleries. Possible cause: the rule was written with a generic class and no specific gallery ID, or it was placed in global CSS.
How to fix it: add the target gallery ID to the beginning of every rule. If the rule really should be global, test every gallery type on the site and document it as a shared design setting rather than a local tweak.
The CSS Looks Fine in the Editor but Strange on the Live Page
Symptom: everything is saved in the admin area, but spacing, width, or effects on the public page look different from what you expected. Possible cause: the theme or page builder is adding its own containers, widths, image styles, or effects.
How to fix it: open your browser's developer tools and see which rules are overriding your CSS. Refine the selector using the gallery ID and the internal element. Do not use blanket !important rules without checking first, because that makes future maintenance harder.
The Mobile Layout Breaks After Adding CSS
Symptom: the gallery looks good on desktop, but on mobile the images become too small, get cropped, or the spacing becomes excessive. Possible cause: a fixed width, an overly thick border, aggressive hover scaling, or a rule that does not account for the responsive grid.
How to fix it: remove the fixed width, reduce the zoom effect, and check image size and cropping settings in Envira Gallery. If you need a separate mobile style, use a short media query and always test on a real device.
The Problem Started After a Theme or Plugin Update
Symptom: the CSS used to work, but the appearance changed after an update. Possible cause: the theme, Envira Gallery, or another plugin changed the markup, CSS priority, or the way images are rendered.
How to fix it: do not rewrite the entire snippet right away. First, temporarily disable the local CSS and check the base gallery. Then restore the rules one at a time. If the selector no longer matches the real markup, replace it with an updated one after checking the page in browser tools.
Questions About Configuring Envira Gallery CSS
Can You Use Envira Gallery CSS Without Knowing CSS?
Not completely. The addon gives you a place for custom code, so you need to understand at least basic selectors, braces, and properties. But for small changes, short proven snippets are enough: spacing, a border, hover opacity. Start with one rule and check the result after every change.
Why Does the Documentation Show Different Selectors Like #envira-gallery-xx and #envira-gallery-wrap-xx?
Different markup elements control different parts of the output. One selector may target the main gallery container, while another targets a wrapper or inner element. Do not choose a selector at random. First decide what you want to change, then inspect the markup in developer tools and use your own gallery ID.
Can You Add One CSS Snippet to All Galleries at Once?
Yes, but global Additional CSS or theme styles are usually a better fit for that. The CSS Addon is more convenient for a specific gallery. If the rule needs to work everywhere, do not manually copy it into dozens of galleries, because that will make the site harder to maintain.
Does the Same Approach Work for Albums?
Envira's official documentation says similar CSS options are available for albums in the Misc tab as well. Even so, the selectors and IDs should be checked separately, because albums and galleries may use different markup.
Will the CSS Addon Affect Site Performance?
A small local CSS snippet is usually not a major performance factor. But overly complex effects, large background images, heavy shadows, and aggressive animation can make the experience feel worse, especially on mobile devices. Start with simple properties and test the page after clearing the cache.
What Should You Do If the CSS Disappears After an Update?
First, check whether the snippet is still present in the Custom Gallery CSS field. If it is, open the public page, clear the cache, and inspect the markup. After an update, the theme or plugin may have changed classes, rule priority, or container structure. In that case, you need to refine the selector, not pile on more random rules.
Do You Need to Add !important?
Only if you understand exactly which rule you are overriding and why a normal selector is not enough. Overusing !important turns a small tweak into a maintenance problem later. Start by strengthening the selector with the gallery ID and the specific inner element.
When Envira Gallery CSS Is the Right Choice
Envira Gallery CSS is worth using when you already have a working Envira Gallery setup and need to bring one specific gallery to the right visual state. Its strongest use case is local styling: one gallery gets a border, spacing, hover effect, or custom caption treatment, while the other galleries on the site stay unchanged.
Before rolling it out, verify the base gallery, find its ID, add a short CSS rule in the correct field, save the gallery, and test the result on the published page. If the change does not appear, do not rewrite the code blindly. Check the field, the ID, the Envira cache, the site cache, and theme conflicts. That order makes the process predictable.
If the workflow looks right for your site after testing, you can download the ZIP archive and try it on a staging copy or a safe working gallery. Start with one small rule, confirm the result, and only then move on to more noticeable styling.


