Can I use EL for external CSS files with JSF?

前端 未结 6 1111
情歌与酒
情歌与酒 2020-12-19 07:46

In external style sheets of my current JSF project, there are hard-coded links to external resources like

.someId { background-image:url(/context/resources/i         


        
6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-19 08:17

    I put the CSS images always in a subfolder of the CSS folder. E.g.

    • /resources/css/style.css
    • /resources/css/images/example.jpg

    This way you just end up like

    .someId { background-image:url(images/example.jpg); }
    

    Yes, they are resolved relative to the URL of the CSS file itself, not to the main JSF/HTML page.

提交回复
热议问题