如何使用百里香解析的URL设置样式标签的background属性。
我有
<div style="background:url('<url-to-image>')"></div>
<img th:src="${@/<path-to-image>}">
在百里香中设置样式属性是否等效?
如果th:style
用于设置样式属性,则可以实现:
<div th:style="'background:url(' + @{/<path-to-image>} + ');'"></div>
在百里香论坛上查看此主题。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句