I have the following code to add a bg image on my Subsite home page. It does'nt seem to work and I have a solid feeling its the way I'm referring the image (stored under a picture library named 'Image Library' on the same subsite). I have it saved in a text file under a document library (also under the same subsite) and then just use that link on the content editor webpart. Test link seems to bring it up just fine, so I am good there. Any ideas on how to get this functional?

<style type="text/css">

  • Using firebug or IE tool, try adding the background-image property and the source url, see if it changes, also make sure s4-mainarea id exists and try adding div#s4-mainarea {...} or use !important property to see if it overrides the default value.
    – Aveenav
    Commented Jan 27, 2016 at 0:03

1 Answer 1


Try this, it worked for me. Try to use !important if it doesn't work.

background-image: url(../images/image.jpg);
background-size: cover;
overflow-x: hidden;}
  • Thanks....but for some reason my bg image doesnt really stick. It just seems to flicker for a second and go away. Look like the master page is overriding it
    – user7400
    Commented Jan 28, 2016 at 17:56
  • Try to modify the #s4-workspace from dev tools and see if you could get it to work. Also, try to use !important with the background-image property and see if that works Commented Jan 28, 2016 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.