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?
div
th:if
Nor
If you are looking to add or remove class accordingly if the url contains certain params or not .This is what you can do
If the url contains 'home' then active class will be added and vice versa.