Custom CSS

Introduction

CSS allows you to customize the style of your survey, including colors, typography, and other branding elements. Custom CSS is only available to users with active subscriptions.

Numerous online resources are available to guide you in mastering these languages and implementing the desired changes to your surveys.

To add CSS to your survey, navigate to the Custom CSS section in the Style tab.

Navigate to settings and then custom code.

Classes

Classes are used to target specific elements on the page. Below are some commonly customized classes.

General

These classes apply to all questions.

A survey question with classes highlighted. Use the browser tools in your survey to find desired classes.
.question-width-container will change the width of all questions in the survey, but additional classes are used in CBC and grid to handle the dynamic content used in them. If you use this class, ensure those questions appear as desired.

Constant sum

A survey question with classes highlighted. Use the browser tools in your survey to find desired classes.

Grid

A survey question with classes highlighted. Use the browser tools in your survey to find desired classes.

The width of the grid resizes based on the number of columns and length of row label text. This ensures the grid is easy to read. To handle this, instead of the typical class, .question-width-container, grid uses the .extended-width-container class to manage the dynamic width. This class is also used with CBC concepts.

The mobile view of grid uses additional classes:

A survey question with classes highlighted. Use the browser tools in your survey to find desired classes.

Numeric grid

Numeric Grid CSS classes

Bipolar grid

A bipolar grid with its CSS classes highlighted.

Here are the classes for mobile sizes:

Grid — Mobile Bipolar

Multiple choice

Multi-select

A survey question with classes highlighted. Use the browser tools in your survey to find desired classes.

Single-select

Single Select

Single-select dropdown

Single Select Dropdown CSS classes

Numeric

Numeric

Open-end

Single-line

Single Line Open End

Multi-line

A survey question with classes highlighted. Use the browser tools in your survey to find desired classes.

Ranking

A survey question with classes highlighted. Use the browser tools in your survey to find desired classes.

Text entry

A survey question with classes highlighted. Use the browser tools in your survey to find desired classes.

Choice-based Conjoint

A survey question with classes highlighted. Use the browser tools in your survey to find desired classes.

The width of the CBC task resizes based on the number of concepts. This ensures the CBC is easy to read. To handle this, instead of the typical class, .question-width-container, CBC uses the .extended-width-container class to manage the dynamic width. This class is also used with grid questions.

Cbc 2

 

Mobile CBC

A survey question with classes highlighted. Use the browser tools in your survey to find desired classes.
A survey question with classes highlighted. Use the browser tools in your survey to find desired classes.

MaxDiff

A survey question with classes highlighted. Use the browser tools in your survey to find desired classes.

Anchored MaxDiff questions utilize grid styles. If your MaxDiff includes an anchored question, you can choose to style it separate from the grid questions in your survey. To target the anchored question in your survey, use this code:

[question="MaxDiff Name_anchor"] {}

Target a specific question

When the classes in the section above are used, changes will affect all of the questions that use the class. To target a specific question, use this code:

[question="Question name"] {}

Survey updates

Discover is a live service, regularly receiving automatic security and design updates each week. When either CSS or JavaScript is used, we "freeze" these automatic updates to prevent them from unintentionally interfering with your code. Though updates are not given automatically at this point, surveys are given the latest improvements every time the survey is republished.

If you are using code, before publishing we strongly encourage you to use the test functionality in Discover and run through the parts of your survey that include custom code to ensure there are no unintended interactions.

Note: To maintain the safety and security of Discover, surveys with custom code that haven’t been published in six months will be updated to receive the latest improvements.