Add styles and scripts to Sitecore Forms
Add css and script files to customize your forms.
Sitecore Forms uses css and script files located in: <siteroot>/sitecore modules/Web/ExperienceForms
.
To start using custom styles and scripts in your forms:
In the Content Editor, go to
sitecore/Forms
, click the form that you want to add a script or style to and, in the Scripts or Styles field, add the name of your custom script or style file.Note
If you want the script or styles to be available for all forms, you must update the settings on the standard value item:
sitecore/Templates/System/Forms/Form/__Standard Values
Add your custom style or script file to one of the following folders:
Scripts :
<siteroot>/sitecore modules/Web/ExperienceForms/scripts
Styles:
<siteroot>/sitecore modules/Web/ExperienceForms/css
To render the files, you must Add the following methods to your layout:
@Html.RenderFormStyles()
@Html.RenderFormScripts()
To use the custom styling in your forms, you can add the css class to the form element.