我正在使用bootstrap 3,单击x按钮时我的警报元素没有关闭。
<div runat ="server" class="alert alert-error modalEditError"
id="modalEditError"
visible ="false">
<button class="close" type="button" data-dismiss="modalEditError">×</button>
<strong>The updated interview information was not saved!</strong>
<div id="Div2" runat="server"></div>
</div>
注意: CSS类'modalEditError'确实不存在;这就是我试图让机器关闭,以防机制在类名而不是id值上运行。
答案 0 :(得分:1)
您的代码缺少alert-dismissible
课程,而按钮上的data-dismiss
应该定位alert
:
<div class="alert alert-danger alert-dismissible" runat ="server" id="modalEditError" visible ="false">
<button class="close" type="button" data-dismiss="alert">×</button>
<strong>The updated interview information was not saved!</strong> <div id="Div2" runat="server" ></div>
</div>
另请注意,alert-error
不是引导类,但alert-danger
(红色)是。