Product Requirements |
Custom HTML, CSS, or JavaScript is insertable when designing a Build your own display. Inserting the code allows users to influence the display's design and behavior beyond what is available by default.
Things to know
- Custom code is not available to users of Privy Free accounts.
- Custom code is not available in displays created using Plays.
- Custom code is only recommended for users with proficiency in the topic or those with access to a developer. Without a complete understanding of your site, custom code targeting your display can impact your site pages. For this reason, Privy's support team is unable to help you create or customize displays with code beyond the general guidance covered in this guide.
Insert the code
To insert custom code into a Build your own displays:
- Navigate to Convert > All Displays and select or create a display with a display.
- In the Create step, select the first Design option to access the display editor.
- Select the Add element option from the sidebar, followed by the Add HTML option from the subsequent dropdown menu.
- Select the new HTML element from the sidebar's Elements list.
- Add the desired HTML, CSS, or JavaScript code into the element's editing area.
- Select the Save option at the upper right when you are done with your changes.
In the example shown below, the custom CSS included in the element removed the "X" option from the bar display. This design change means the announcement cannot be dismissed.
Common uses
Remove the closing "X" from the corner of a display.
<style>
.privy-dismiss-content {
display: none;
}
</style>
Remove the shadow design from a display's button.
<style>
.privy-element.privy-button-element.privy-button-flat {
box-shadow: 0 0px !important;
}
</style>