我只需使用此 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>
为什么这不起作用?
最佳答案
尝试 - DEMO
CSS:
/* CSS used here will be applied after bootstrap.css */
#firstModal {
background-color: green;
opacity: 1 !important;
filter: Alpha(opacity=50);
}
关于css - 定位具有特定 ID 的 Bootstrap 模式 CSS 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25660175/