set widget background image

bubuprasadswain
Tera Guru

Hi All,

I am using custom homepage search widget cloning from OOB homepage search widget.

How to add background image for this particular widget.

find_real_file.png

Thanks in advance!!

Thanks & Regards,

Bubuprasad

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

You could put a div tag around with a class that defines the background image.



<div class="myBackground">


        // The rest of the HTML for the widget


</div>



CSS:


.myBackground {


        background-image : url("location_of_my_image");


}



CSS background-image property


View solution in original post

8 REPLIES 8

Jaspal Singh
Mega Patron
Mega Patron

Hi Bubuprasad,



Look for Service Portal >> Pages. Open any page & look for related link at the bottom


find_real_file.png



Open in Designer


find_real_file.png


kristian dimitr
Tera Guru

Hi Swain,



In order to add a background image to your home page in SP: 1.Open your portal into the application 2.navigate to Homepage of the portal 3.Click on Container 1 and open it, Background image is located here.



Kristian!


bubuprasadswain
Tera Guru

Thank you all, I am marking Chuck's answer correct as I want to change background of only widget not the whole container.



Thanks again  


I completely agree. Adding a background image to the container of the widget is different than the widget itself. There could be multiple widgets (or widget instances) in a container - you may only want the background image to be a applied to the widget. 
Chucks method is right, but the issue I run into is images being migrated via update sets. I have trouble moving them between instances.