Style local background image
How do I include a local image for the style background-image
URL
, that is stored outside my application?
Actually, I can only show it in Internet Explorer with this in my CSS:
.class {
background-image: url(file:///C:/tempfolder/开发者_C百科image001.bmp);
}
But I need it to work for any other browser.
Use relative paths, for example:
.class {
background-image: url(../tempfolder/image001.bmp);
}
As far as I'm aware, most browsers restrict mixed-domain requests like this. In this case you're connecting to a remote server while requestion local content. Even though in your case this is perfectly reasonable, this could be put to malicious use. I believe that the simple answer is: you can't do it because of security concerns.
精彩评论