百里叶HTML如果其他线路在同一条线中



我在胸腺html页面中有这个代码

<div th:if="${book.htmlIconColor != null}" >
<i class="fa fa-exchange fa-2x" th:style="${'color:' + book.htmlIconColor + '; text-align: center;'}" aria-hidden="true"></i>                     
</div>
<div th:if="${book.htmlIconColor == null}" >
<i class="fa fa-exchange fa-2x"  aria-hidden="true"></i>                     
</div>

尝试这样的东西:

condition ? first_expression : second_expression;

例如

<i class="fa fa-exchange fa-2x" aria-hidden="true" th:style="${book.htmlIconColor} ? 'color:' + ${book.htmlIconColor} + '; text-align: center;' : 'text-align: center;'"></i>

最新更新