Customization
Use custom CSS classes
You can change the look and feel of a slider.
Related sample: Slider. Styling (custom CSS)
Follow these steps:
- Add one or more CSS classes with the settings you need. Place them in the
<style>section of your HTML page or in a separate stylesheet. If you use a stylesheet, include it on the page:
<style>
.my_first_class {
/*some styles*/
}
.my_second_class {
/*some styles*/
}
</style>
- Specify the name of the class you created (or several class names separated by spaces) as the value of the
cssproperty in the Slider configuration:
const slider = new dhx.Slider("slider_container", {
css:"my_first_class my_second-class"
});
For example:
<style>
.custom {
--dhx-color-primary: #118d8d;
}
</style>
<script>
const slider = new dhx.Slider("slider_container", {
css: "custom"
});
</script>