Skip to main content

Use CSS in a web experiment

Abstract

Describes how to use a Cascading Style Sheet (CSS) in a web experiment to apply your organization's branding (Sitecore Personalize).

You can use a Cascading Style Sheet (CSS) in a web experiment to apply your organization's colors, fonts, layouts and branding to the experiment.

To use CSS in a web experiment:

  1. On the Build screen, click Edit next to the variant you want to configure.

  2. In the template editor, on the CSS tab, enter any CSS that you want to use to format the layout of the web experiment.

  3. Click Save.

  4. Click Close. You return to the Build screen.

Note

If you use an out-of-the-box web template, or if you have copied the JavaScript from such a template, you must reference an attribute from the API response within a context object. For example, to include in the CSS an imageURL from the API response, reference it as follows:

background-image: url(“{{context.imageURL}}”)