1

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">
#s4-mainarea{
    background-
    image:url('https://share.ey.net/sites/test/test%20page/Image%20Library/20H00217.jpg'););

}
.s4-ca
{
 background-color:transparent;
}
</style>
1
  • 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
    Jan 27, 2016 at 0:03

1 Answer 1

0

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

#s4-workspace{
background-image: url(../images/image.jpg);
background-size: cover;
overflow-x: hidden;}
2
  • 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
    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 Jan 28, 2016 at 17:58

Your Answer

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

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