javascript-如何使围绕模态的警报的div变暗?
作者:互联网
我需要向用户显示警报,并且我希望它很漂亮.因此,我使用Bootstrap的alert类,并向div用户显示如下:
<div class="alert alert-warning alert-dismissible" role="alert">
Some text
</div>
此代码仅显示一个div.我想要的是使除此div以外的所有内容变暗(如Bootstrap中的模式).我怎样才能做到这一点?
解决方法:
打开模式,仅显示警报.
http://jsfiddle.net/phLg32eL/1
HTML:
<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Open alert
</button>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="alert alert-warning alert-dismissible" role="alert">
Some text
</div>
</div>
</div>
</div>
CSS:
.modal-content {
height:52px
}
标签:twitter-bootstrap,css,html,javascript,jquery 来源: https://codeday.me/bug/20191121/2051124.html