Stylesheets and JavaScript
Information on working with stylesheets and JavaScript in Umbraco.
Stylesheets and JavaScript files control the appearance and behavior of your website. In Umbraco, these files live in the wwwroot folder of your project. You can also manage them from the backoffice.
This article explains how to work with stylesheets and JavaScript and clarifies how styling works with the Rich Text Editor (RTE) Data Type.
Stylesheets in the Backoffice
Stylesheets are used to define how your website content is displayed. You can create and manage CSS files from the Settings section.
Creating a stylesheet
To create a stylesheet:
Go to Settings section in the backoffice.
Expand the Stylesheets folder.
Click the ⋯ (options) menu.
Select Create.

Select Stylesheet file.
Give the file a name and add your CSS.

Click Save.
The stylesheet is saved in the wwwroot/css folder of your project by default.
Using stylesheets
Stylesheets created in the backoffice are standard CSS files. To use them on your website, reference them in your templates or layout files:

or
JavaScript files in the Backoffice
JavaScript files can also be created and managed from the backoffice.
Creating a JavaScript file
To create JavaScript files:
Go to Settings section in the backoffice.
Expand the Scripts folder.
Click the ⋯ (options) menu.
Select Create.

Select JavaScript file.
Give the file a name and add your JavaScript code.

Click Save.
The JavaScript is saved in the wwwroot/scripts folder of your project by default.
Using JavaScript files
Navigate to the template where you would like to reference your scripts:

Rich Text Editor styling
Editor styles are configured using the Style Menu in RTE. To provide editors with predefined styles such as classes, tags, or IDs, you must configure them as part of the Style Menu configuration. For more information, see the Rich Text Editor article.
If content appears differently in the backoffice editor than on the frontend, it may be caused by additional stylesheets applied in your site.
Last updated
Was this helpful?