Setting CSS background-image where the image is a resource or WebResource in a .NET assembly

喜你入骨 提交于 2019-12-11 02:51:46

问题


I am writing an ASP.NET server control that will live in its own assembly. It's a refactoring of something already in the app, which uses CSS background images.

I don't want to require the user of the assembly to have to install a separate images folder, so -- if it's possible -- I'd like to store the images as resources in the server control's assembly. But I'd still like to use CSS to set them as background images. Unless I'm mistaken, CSS is my only option for setting background images.

Is this possible? I've seen some markup in places that suggests it might be, notably this, this, and this, but nothing sufficiently specific to CSS background images that I could be confident it would work: most articles that deal with this assume you are loading either script or CSS files.


回答1:


I found the answer! The answer is: YES, you can do it! And here's how: this and this.



来源:https://stackoverflow.com/questions/7785173/setting-css-background-image-where-the-image-is-a-resource-or-webresource-in-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!