我需要向用户展示alert
,我希望它漂亮。所以我使用 Bootstrap的警报类,并向用户div
显示如下:
<div class="alert alert-warning alert-dismissible" role="alert">
Some text
</div>
此代码只显示div
。我想要的是使所有内容变暗,除了这个div
(就像Bootstrap中的模态一样)。我怎么能这样做?
答案 0 :(得分:3)
打开模态,仅显示警报。
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
}