Saturday, April 20, 2013

Add Background image to the site page

Hi Guys, I had a requirement from customer to add a background image to the existing site page. I just wrote a css style to achieve this through Content editor webpart. Here I noted downn my brief work . The Background image needs to be applied to the BODY tag of the page and here is my css script.
 <style type="text/css">
  
 BODY{
  
 background-image:url("/sites/yoursite/images/bgimage.jpg");
  
 background-position:center;
  
 background-repeat:no-repeat;
  
 }

.s4-ca {
 BACKGROUND-COLOR: transparent
}

  
In addition to the above code,you must add the background color transperent style to overcome the white background. Use this code in CEWP, if you have a requirement in only page, Otherwise, add the same style snippet in Master page head tag if you have enough permissions.

No comments: