Set background image URL in CSS file to another site

303 views Asked by At

I set a background image URL in CSS file to another site as below:

body.teaching {
    background: url("http://sample.com/beijing.png") no-repeat no-repeat;
    background-size: 100% 100%;
}

After I deploy to the server (e.g. www.foo.com), the URL changed like below (404 error):

http://www.foo.com/css/http:/sample.com/beijing.png

I think it is caused by CssRewriteUrlTransform, so my question is: What is the correct way to set the image URL to another site? I don't want to disable CssRewriteUrlTransform, because many other image URLs need to be transformed.

1

There are 1 answers

0
James Hao On BEST ANSWER

I extract the background url to another css and without applying CssRewriteUrlTransform, it works now