css - 定位具有特定 ID 的 Bootstrap 模式 CSS 类

标签 css twitter-bootstrap twitter-bootstrap-3

Demo

我只需使用此 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/

相关文章:

html - 我的 Github 页面不会将自定义 css 文件应用到网站

html - 页脚应该在页面/内容的底部

jquery - 等于 jQuery 对象的变量

CSS:字体颜色不会改变

twitter-bootstrap - 如何使用 ng2-bootstrap 从 Bootstrap 3 切换到 Bootstrap 4?

javascript - 动态表 - 自动显示

ruby-on-rails - Rails will_paginate 指向错误的 twitter bootstrap nav-tab

jquery - 当用户在其外部单击时,如何在 twitter bootstrap 3.1 模式对话框中的单击事件之前防止模糊事件。!

html - 如何在菜单页面中创建两行图标

html - Bootstrap 如何让文本在 div 容器中垂直对齐