css – HTML-attribute中的JSTL if-statement

前端之家收集整理的这篇文章主要介绍了css – HTML-attribute中的JSTL if-statement前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
是可能在JSTL中做这样的事情: @H_403_2@<div class="firstclass<c:if test='true'> someclass</c:if>"> <p>some other stuff...</p> </div>

有什么办法让这个工作,或者有更好的方法添加一个类通过查看一个JSTL-if语句?

解决方法

@H_403_2@<c:if test='true'> <c:set value="someclass" var="cssClass"></c:set> </c:if> <div class="${cssClass}"> <p>some other stuff...</p> </div>

猜你在找的CSS相关文章