Bootstrap不允许的警报会一直显示在页面加载上

时间:2018-05-21 04:34:06

标签: html bootstrap-4 thymeleaf alert

 <div class="alert alert-warning alert-dismissible " aria-hidden="true">
       <button type="button" class="close " aria-hidden="true" data-dismiss="alert">&times;</button>
       <strong th:text="${error}"></strong>
 </div>

虽然我使用了aria-hidden =&#34; true&#34;警报会一直显示在页面加载上,如图中所示。请问快速建议吗?

image

1 个答案:

答案 0 :(得分:0)

来自this wonderful answer

  

aria-hidden属性告诉屏幕阅读器是否应该忽略该元素

如果没有错误,您想要隐藏元素。为此,请使用

th:if="${error}"

<div>元素上。

相关问题