How to set the background property of a style tag with a thymeleaf resolved url.
I have
<div style="background:url('<url-to-image>')"></div>
Is there a <img th:src="${@/<path-to-image>}">
equivalent for setting style attributes in thymeleaf.
You could achieve that if you use th:style
to set your style attribute:
<div th:style="'background:url(' + @{/<path-to-image>} + ');'"></div>
Check this thread on thymeleaf forum.