Twitter bootstrap 引导模式小狗站在背景后面的侧边栏上

Twitter bootstrap 引导模式小狗站在背景后面的侧边栏上,twitter-bootstrap,bootstrap-modal,sidebar,Twitter Bootstrap,Bootstrap Modal,Sidebar,Bootstrap的模式弹出窗口一直出现在后台。已尝试应用: 而且似乎不起作用。我在想,也许是因为它在一个边栏里。页面其余部分的内容通过include()调用。模态似乎应用于include()层 @德克斯特:在文章中,我们已经提到了“将整个模式从代码的其余部分移到最底层”。你试过以下代码吗 <body> <div class="nav nav-sidebar"> <input type='button' value='SURVEY!' clas

Bootstrap的模式弹出窗口一直出现在后台。已尝试应用:

而且似乎不起作用。我在想,也许是因为它在一个边栏里。页面其余部分的内容通过include()调用。模态似乎应用于include()层

@德克斯特:在文章中,我们已经提到了“将整个模式从代码的其余部分移到最底层”。你试过以下代码吗

<body>
    <div class="nav nav-sidebar">
    <input type='button' value='SURVEY!' class='btn btn-md btn-primary' data-toggle='modal' data-target='#modal'>

    </div>

    <!--Your Modal Body Here -->
    <div class='modal fade' id='modal' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
      <div class='modal-dialog'>
        <div class='modal-content'>
          <div class='modal-header'>
              <!--Your Modal Close Button-->
              <button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>
              <!--Your Modal Title-->
            <h4 class='modal-title' id='myModalLabel'>Please Confirm Action</h4>
          </div>
          <div class='modal-body'>
            <!--Your Modal content here-->
            <p>Are you sure you want to proceed with your action ?</p>
          </div>
          <div class='modal-footer'>
           <a href='home.php'><button type='button' class='btn btn-primary'>Yes I Do</button></a>
          </div>
        </div>
      </div>
    </div>
</body>

&时代;
请确认行动
您确定要继续您的操作吗


页面仅包含侧栏和导航栏。其余部分仅包含在
include()
中。所以我认为这不是我要寻找的解决方法;在css代码中查看发生了什么?似乎z-index不适用于
。模态内容
购买是的,我知道你要做什么了。我需要同样的概念。谢谢你的努力!那么现在的内容已经位于背景之上了,是吗?不知道为什么,但我们可能需要遵循引导中的html结构来获得我们想要的:)我的父容器是
,并尝试删除
侧边栏
类,它工作得非常好,但删除了该类的优点。使用侧边栏类更新
.sidebar {
  display: none;
}
@media (min-width: 768px) {
  .sidebar {
    position: fixed;
    top: 30px;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: block;
    padding: 22px;
    overflow-x: hidden;
    overflow-y: auto; 
    background-color: #f5f5f5;
    border-right: 1px solid #eee;
  }
}
<body>
    <div class="nav nav-sidebar">
    <input type='button' value='SURVEY!' class='btn btn-md btn-primary' data-toggle='modal' data-target='#modal'>

    </div>

    <!--Your Modal Body Here -->
    <div class='modal fade' id='modal' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
      <div class='modal-dialog'>
        <div class='modal-content'>
          <div class='modal-header'>
              <!--Your Modal Close Button-->
              <button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>&times;</span></button>
              <!--Your Modal Title-->
            <h4 class='modal-title' id='myModalLabel'>Please Confirm Action</h4>
          </div>
          <div class='modal-body'>
            <!--Your Modal content here-->
            <p>Are you sure you want to proceed with your action ?</p>
          </div>
          <div class='modal-footer'>
           <a href='home.php'><button type='button' class='btn btn-primary'>Yes I Do</button></a>
          </div>
        </div>
      </div>
    </div>
</body>