By using Thymeleaf as template engine, is it possible to add/remove dynamically a CSS class to/from a simple div
with the th:if
clause?
Normally, I could use the conditional clause as follows:
<a href="lorem-ipsum.html" th:if="${condition}">Lorem Ipsum</a>
We will be creating a link to the lorem ipsum page, but only if condition clause is true.
I'm looking for something different: I'd like the block to always visible, but with changeable classes according to the situation.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…