开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜