I have this piece of code:
<h2 class="title" >
<a th:href="${blogItem.getLink()}" th:text="${blogItem.getTitle()}"><style>h1 {color:'${blogItem.getTitleColor()}';} Title</style></a>
</h2>
but I have this error: Mismatched property value (<color> | [initial | inherit | unset | revert])
>Solution :
Assuming you want the link styled as a header, you can surround the link with <h1> and use Thymeleaf’s th:style to achieve what you want:
<h1><a th:href="${blogItem.getLink()}" th:text="${blogItem.getTitle()}" th:style="'color: ' + ${blogItem.getTitleColor()} + ';'">Title</a></h1>