Rya*_*Tee 2 html css bootstrap-modal bootstrap-5
我正在尝试 Bootstrap,但 Bootstrap 警报按钮不知何故根本不起作用。我所做的就是从 Bootstrap 复制代码:
但是页面显示的是这个?按钮的设计是关闭的,并且它不起作用(不关闭)。我检查了所有内容:alert-dismissible
是否存在,按钮有data-dismiss = 'alert'
,但不知何故它不起作用。我包含的脚本是 Bootstrap 捆绑版本。
您更改了示例的一小部分:您data-dismiss
应该是data-bs-dismiss
并且按钮上的类应该是btn-close
而不是close
:
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<strong>Holy guacamole!</strong> You should check in on some of those fields below.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
Run Code Online (Sandbox Code Playgroud)
经过仔细检查,我注意到您的警报是Boostrap 4 警报。在您的示例中,您使用 Bootstrap 5 中的 CSS 和 JavaScript,其中可忽略的警报应类似于上面的示例。
归档时间: |
|
查看次数: |
1336 次 |
最近记录: |