Articles in this section
Category / Section

How to set background image for Sidebar?

1 min read

How to add background image for EJ2 Sidebar control.

 

Solution

 

We can set the background image for Sidebar control using CSS styles. Please refer to the below code block.

 

 /* sidebar styles*/
 #default-sidebar {
    background-color: #224562;
    color: #224562;
    background-            image: url(https://mdbootstrap.com/img/Photos/Others/sidenav4.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border:none;
    }
 

 

 

Refer to the below screenshot of output of the Sidebar with background image.

 

Sidebar with bg image

 

 

Sample link: https://stackblitz.com/edit/sidebar-bgimage

 

Documentation: https://ej2.syncfusion.com/documentation/sidebar/getting-started/

CSS structure: https://ej2.syncfusion.com/documentation/sidebar/style/

API reference: https://ej2.syncfusion.com/documentation/api/sidebar/

Live demo: https://ej2.syncfusion.com/demos/#/material/sidebar/default.html

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied