Summary: This guide explains how to apply custom CSS to your Secure Privacy cookie banner—both inside the banner iframe and to its outer wrapper container. Whether you want to adjust padding, button styles, text colors, positioning, or shadows, this walkthrough covers the correct approach for each scope, including the /SP-OUTER-START/ and /SP-OUTER-END/ syntax for outer container styling.
Who Is This Guide For?
- Website administrators and designers customizing the visual appearance of their Secure Privacy cookie banner
- Developers applying CSS to fine-tune banner styles beyond the visual editor's options
- Marketers and compliance managers maintaining brand consistency across their consent UI
Important: Risks of Outer Wrapper CSS
Common Issues & Fixes: Custom CSS on Cookie Banners
-
CSS changes inside the banner aren't affecting the outer wrapper?
Inner banner CSS applies only within the iframe and cannot reach the outer container. To style the outer wrapper, use the/*SP-OUTER-START*/.../*SP-OUTER-END*/syntax as described above. -
Outer wrapper styles are affecting other parts of your website?
Your CSS selectors are likely too broad. Scope them as specifically as possible to the banner's outer container class. Always test on a staging site before pushing to production to catch unintended side effects. -
Concerned about the risks of injecting CSS into page HTML?
Yes — outer wrapper CSS is injected directly into your site's HTML, so careless or generic styles can override other page elements. Use highly specific selectors, avoid global resets, and review changes in DevTools before publishing.
Frequently Asked Questions (FAQ)
What is the difference between inner banner CSS and outer wrapper CSS in Secure Privacy?
Inner banner CSS is scoped inside the banner's iframe and can only affect elements within the banner itself—such as buttons, text, and padding. Outer wrapper CSS, placed between /*SP-OUTER-START*/ and /*SP-OUTER-END*/, is injected into the page HTML and controls the outer container's layout properties like position, margin, and shadow.
Can inner banner CSS affect my website's other elements?
No. Because inner banner CSS is applied inside an iframe, it is fully isolated from the rest of your page. Only CSS placed between the /*SP-OUTER-START*/ and /*SP-OUTER-END*/ tags can affect elements outside the banner.
Where exactly do I add custom CSS in Secure Privacy?
Go to Design > Cookie Banner in your Secure Privacy dashboard. The Custom CSS input field is located below the banner preview. Both inner and outer wrapper CSS rules are entered in this same field — the /*SP-OUTER-START*/ tags differentiate which scope applies.
What kinds of styles should I apply to the outer wrapper vs the inner banner?
Use inner banner CSS for typography, colors, padding, and button styles. Use outer wrapper CSS for positioning, margins, box shadows, z-index, and other layout-level properties that control how the banner sits on the page.
Need More Help with Banner CSS Customization?
If you have questions or need assistance with custom CSS for your Secure Privacy cookie banner, contact our support team at [email protected].