我只需要使用此CSS规则更改我在Bootstrap 3中使用的具有特定ID #firstModal
的其中一个模式的背景
#firstModal.modal-backdrop {
background-color: green;
opacity: 1 !important;
filter: Alpha(opacity=50);
}
这是模态
<div id="firstModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">First Modal</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
你可以告诉我为什么这不起作用吗?感谢
答案 0 :(得分:1)
<强> CSS:强>
/* CSS used here will be applied after bootstrap.css */
#firstModal {
background-color: green;
opacity: 1 !important;
filter: Alpha(opacity=50);
}