Response Page Custom CSS

Overview

Custom CSS lets you restyle DataDome's response pages - the Slider page, the Block page, and the Device Check page - to match your brand: colors, typography, backgrounds, spacing, and layout.

⚠️

Eligibility

Custom CSS is part of Advanced Response Page Customization, available exclusively to customers on an Enterprise or Premium plan.

📘

Looking for standard options?

Logo, button colors, and font are configurable without any code in the Brand tab, see Response Pages. Prefer the standard options whenever they cover your need: they are validated by DataDome and cannot break the page.

How your CSS is applied

Custom CSS is edited in your dashboard: go to Management → Response Pages, open the customization of the domain to configure (Default applies to all domains that have no customization of their own), then open the Advanced code tab and select the CSS editor. The same CSS applies to the Slider, Block, and Device Check pages, whatever page is selected in the Page selector: use that selector and Refresh preview to check how your changes render on each page before saving.

Advanced code tab - CSS editor

Your CSS is stored per domain (the Default customization applies to all domains; a domain-specific customization overrides it) and injected inline into the response page document:

Page typeWhere your custom CSS lands
Slider PageInline <style> in the <head>, after DataDome's base stylesheet
Block pageSame as Slider - both pages share one template and the same custom CSS
Device CheckThe same shared CSS is injected (inline, after the base stylesheet) when Device Check display is enabled. There is no separate Device Check CSS - style it only via scoped rules and the spinner variables below.
📘

Device Check spinner colors

The spinner colors of Device Check are customized with dedicated CSS variables, see example 4.

Key consequences:

  • Paste plain CSS only - do not wrap it in <style> tags. Your CSS is inserted inside an existing <style> element; adding tags there breaks the page styling.
  • One CSS field styles all three page types. Scope your rules per page type (see below) unless they are truly global.
  • Because your CSS comes after the base stylesheet, equal-specificity rules win by source order - no !important needed in most cases.
  • Exception: the button colors configured in the Brand tab (standard options) are emitted with !important. Change them in the Brand tab rather than fighting them in CSS.
  • The CSS editor auto-formats your code on paste and on save (you can also click Format), and displays the size used against the 40 KiB limit. There is no other validation: your CSS is applied verbatim, so a mistake can visually break the challenge for real users.
⚠️

Test carefully

Saving changes publishes your CSS in production with no draft state, and it reaches live pages after a cache reload that can take several minutes.

Scoping rules per page type

The response pages don't share identical markup, and the same CSS field applies to all of them. Most branding rules (colors, fonts, backgrounds) can safely be shared across page types. When a rule must apply to a single page type, use the response-type marker: every response page carries a class and a data-dd-response-page attribute on its <body> element identifying the page type being served.

Page typeBody classData attribute
Slider Pagedd-response-page--captchadata-dd-response-page="captcha"
Block pagedd-response-page--hard-blockdata-dd-response-page="hard-block"
Device Checkdd-response-page--device-checkdata-dd-response-page="device-check"
/* Slider page only */
body.dd-response-page--captcha #captcha-container { margin-top: 24px; }

/* Block page only */
body.dd-response-page--hard-block .captcha__human__title { font-weight: 600; }

/* Device Check page only */
body.dd-response-page--device-check .device-check__main { font-size: 15px; }

These markers are a stable, documented contract: prefer them over anchoring rules to page-specific elements. If you need a fallback for pages rendered before the marker was introduced, #ddv1-captcha-container exists only on the Slider page and .device-check__main only on the Device Check page.

Also account for right-to-left languages: the page sets <body dir="rtl"> for RTL locales, so avoid hardcoded left/right offsets where possible (prefer logical properties like margin-inline-start).

What you can and cannot customize

Supported:

  • Colors, backgrounds (including images), borders, shadows, spacing, sizing
  • Typography, including custom fonts via @font-face
  • Layout adjustments - spacing, alignment, sizing, element ordering (within what CSS allows)
  • Responsive behavior via @media queries - always test mobile viewports
  • Dark mode via @media (prefers-color-scheme: dark)
  • The Device Check spinner colors via CSS variables: --device-check-spinner-color-1 and --device-check-spinner-color-2

Blocked by the page's sandbox:

  • Links or buttons that redirect users to external URLs or open new tabs - the response page runs in a sandboxed iframe that blocks this kind of navigation, so such links silently fail.

Not recommended:

  • Restyling the Slider widget internals - this is a security surface. Customizations that touch it can prevent real users from passing the challenge, and they can break without notice whenever DataDome updates the widget.
  • Hiding or obstructing the challenge, the feedback form, or accessibility affordances.
  • Anything that degrades the minimum 4.5:1 color-contrast ratio (WCAG AA).

To change the texts of the page, use the Content & translations tab rather than CSS (e.g. content: rules): see Advanced Response Page Customization.

If your use case calls for one of the above, please contact your customer representative to discuss it.

Custom fonts

Declare fonts with @font-face. Font files must be hosted on a CDN that serves them with permissive CORS headers (Access-Control-Allow-Origin), because the response page is served from a DataDome domain.

@font-face {
  font-family: "YourBrandFont";
  font-style: normal;
  font-weight: 600;
  src: url(https://cdn.example.com/fonts/YourBrandFont-SemiBold.woff2) format("woff2");
}

* {
  font-family: "YourBrandFont", "Open Sans", Verdana, Arial, sans-serif;
}
⚠️

External Assets

Use stable, public CDN URLs for every external asset (fonts, images). Never reference private storage URLs (e.g. an S3 console link) - they will not load for end users.

Examples

1. Brand colors and typography

body {
  background-color: #f7f5f0;
}
.captcha__human__title {
  color: #1a1a1a;
  font-weight: 600;
}

2. Background image with a card effect

body {
  background: url(https://cdn.example.com/datadome/bg-desktop.jpg) no-repeat center / cover fixed;
}
#captcha-container {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
  border-radius: 12px;
}
@media (max-width: 767px) {
  body {
    background-image: url(https://cdn.example.com/datadome/bg-mobile.jpg);
  }
}

3. Dark mode support

@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #e0e0e0;
  }
}

4. Device Check spinner colors

:root {
  --device-check-spinner-color-1: #0a6bff;
  --device-check-spinner-color-2: #dbe9ff;
}

Testing and rollout

Test on a test domain first

Your CSS is stored per domain - use that to validate changes on a test domain before any production traffic sees them:

  1. Pick a test domain - a staging or low-traffic domain that is already protected by DataDome. The response page is served by DataDome, so traffic on that domain must go through your DataDome integration.
  2. Create a customization for that domain only. In Management → Response Pages, click New customization, enter your test domain, and start from A copy of a customization (Default) so the domain keeps its current look. Then add your CSS in the Advanced code tab and save. A domain-specific customization overrides the Default one, so your other domains keep serving their configuration untouched.
  3. Trigger the response page on the test domain. The preview shows your changes rendered, but always validate on the real page too: create a custom rule (Access Control → Custom Rules) scoped to your test domain and a narrow condition you control - for example your office IP - with a Slider (or Block) response. Visiting the domain from a matching client then serves the real response page with your CSS.
  4. Validate with the checklist below, then roll the validated CSS out with Copy to Other Domains: select CSS and the destination domains (Default and/or your production domains). Remove the triggering custom rule when you are done.
📘

Caching & propagation

Saving publishes your CSS with no draft state; a cache reload can take several minutes before the change reaches all live pages. Response page texts and translations are cached more aggressively for performance: a translation update can take up to 15 minutes to show - including in the preview. Wait for the cache to refresh before concluding a change did not work.

Validation checklist

  • Test all three page types (Slider, Block, and Device Check), on desktop and mobile viewports, in light and dark mode, and in at least one RTL language if you serve RTL locales.
  • Keep a copy of the previous CSS so you can roll back fast.
  • After any change, monitor your Slider pass rate - a styling regression that hides or breaks the challenge shows up as a pass-rate drop.

Related pages


Did this page help you?