On this page

Docs ComplyPress — Cookie Notice & Policy Banner for WordPress

Custom CSS and JavaScript

Optional code that runs with the notice. Open Customization → Custom CSS/JS.

Who can edit it

Only a user who may use unfiltered HTML can change this code. On a single site that is typically an Administrator. Existing code still prints after that user has saved it once.

Custom CSS

  • Write CSS rules only. Do not wrap them in <style> tags.
  • The rules are printed in the page head, inside a style element, when the notice is enabled.

Useful selectors

Target the notice with these classes:

SelectorWhat it styles
.cp-noticeThe notice card (root)
.cp-notice__iconIcon wrapper
.cp-notice__glyphIcon image or SVG
.cp-notice__contentTitle and message column
.cp-notice__titleTitle
.cp-notice__messageMessage body
.cp-notice__actionsButtons row
.cp-notice__buttonAcknowledge button
.cp-notice__policyPolicy link

Example: card border

Style the card with a custom border width and color:

.cp-notice {
	border-width: 2px;
	border-color: #d62f50;
}

Custom JavaScript

  • Write JavaScript only. Do not wrap it in <script> tags.
  • The code runs in the footer for visitors when the notice is enabled.

Click Save changes. Turn the notice off and the custom code is not printed.

Next: How translations work.

Still have questions?

Send us a message from the contact page and we will reply by email.