Custom CSS and element IDs

Custom CSS lets you style a popup or any widget beyond what the builder offers. Open the widget's Layout tab and type your CSS under Advanced › Custom CSS. To target one element, give it an Element ID and write a rule for #that-id.

On this pageAdd custom CSSGive an element an IDWhy your site's CSS doesn't applyStyle phones separatelyTipsNext steps

Updated November 28, 2026

Try the Style tab first: colours, fonts, button shapes and per-element text styles cover most needs without code (see The widget builder). Use custom CSS for what's left — a shadow, an animation, a different layout on phones.

Add custom CSS

  1. Open the widget in the builder and go to the Layout tab.
  2. Open Advanced at the bottom and type your rules into Custom CSS.
  3. The preview updates as you type. Click Publish Changes when it looks right.

Your CSS is kept apart from the Style tab's choices, so picking a new look later doesn't overwrite it.

CSS
/* A soft shadow and a slower hover on the main button */
#widget-main-button {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}
#widget-main-button:hover {
  transform: translateY(-2px);
}

Give an element an ID

An element ID lets your CSS target one part of the widget. It becomes the element's HTML id, so you style it with #your-id. Element IDs are set in the classic builder:

  1. In the builder, open More actions (⋯) and choose Open in Classic Builder. Publish or discard your changes first — unpublished changes don't carry over.
  2. On the Build tab, click the element.
  3. Under Design, type an Element ID, like widget-main-button. Use letters, numbers and hyphens, and make it unique on the page.
  4. Optionally, type CSS declarations under Style, such as color: red; font-size: 16px; — they apply to that element only.
  5. Save with Update and Close.

Why your site's CSS doesn't apply

Forms, inline banners and bars are drawn in their own isolated part of the page (a shadow root). That protects them from your theme — a stray rule in your stylesheet can't break their layout — but it also means a rule in your site's CSS file won't reach inside them. Put widget styles in the widget's own Custom CSS.

Popups: keep every rule scoped. A popup's custom CSS is added to your page while the popup is shown. A broad rule like button { … } would restyle your site's buttons too. Start every rule with an ID from inside your popup.

Style phones separately

Use a media query for small screens, and check the result with the Phone preview in the builder.

CSS
@media (max-width: 600px) {
  #widget-headline {
    font-size: 22px;
  }
  #widget-main-button {
    width: 100%;
  }
}

Some phone settings need no code: Inner spacing on phones on the Layout tab, and Hide on phones for a photo on the Style tab.

Tips

  • Target your own IDs, not the widget's built-in class names — those can change when CROforce updates how widgets are drawn.
  • If a rule doesn't apply, a more specific built-in style may win. Make your selector more specific before reaching for !important.
  • Deleting an element also removes the styles the Style tab set for it.

Next steps

Frequently asked questions

Why doesn't my website's CSS change my widget?

Forms, banners and bars are drawn in their own isolated part of the page, so your site's stylesheet can't reach inside them — and their styles can't break your page. Put the CSS in the widget's Custom CSS instead.

Will picking a new look on the Style tab wipe my CSS?

No. The Style tab's choices are kept apart from your Custom CSS.

Is an element ID the same as the Element IDs on the Display tab?

No. The Display tab asks for the ID of an element on your own page, such as a button that should open a popup. An element ID in this article is one you give to a part of the widget, so your CSS can target it.

Was this article helpful?

Try it on your own site

Add a popup, form or quiz to your site in a few minutes and see what it does for your conversions.