开发者

Robust image URL linking from CSS?

开发者 https://www.devze.com 2023-04-10 22:15 出处:网络
Is there a good way to robustly link to an image in CSS in grails? Originally, I had image paths set to /images/blah, which worked great until the application needed to be deployed in a different cont

Is there a good way to robustly link to an image in CSS in grails? Originally, I had image paths set to /images/blah, which worked great until the application needed to be deployed in a different context.

Is there a better way to link to images than manually specifying the path to the images relative to the css file? This leaves me with crap like ../../../images/blah, which breaks as soon as the CSS file moves unle开发者_Go百科ss you move the file within a smart IDE. This is also ugly as hell.


You can try using Grails tag libraries with the GSParse plugin to have css and js parsed as a gsp file:

http://nerderg.com/GSParse

http://grails.org/plugin/gsp-arse

0

精彩评论

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