Page cover

πŸ’…Add custom CSS to page

This code will let you write CSS code to change the layout of a page.

At this time, we currently don't have an option to add CSS styles directly in the page. Of course, we can use the general CSS style at the design tab in Survey, but these styles will be applied to the whole questionairee.

I've found a way to add CSS styles for the current page with the following javascript code.

Open your Javascript editor and paste the following code.

// Variable to save your styles
var styles = `
    // Add your styles here
`;

// Create a style DOM node
var styleSheet = document.createElement("style");
// Add the styles to the stylesheet
styleSheet.innerText = styles;
// Append the stylesheet in the head of the HTML code
document.head.appendChild(styleSheet);

Inside var styles = ``, write your custom styles. These will affect only the current page.

For example, if you want to set the background color to gray, you can use something like this:

Fig 1. Adding snippet to set custom CSS styles

and then, when you preview your page, you will see the result.

Fig 2. Example of the results of your styles.

Last updated

Was this helpful?