Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 引导模式被推到右侧_Twitter Bootstrap_Ruby On Rails 4_Modal Dialog - Fatal编程技术网

Twitter bootstrap 引导模式被推到右侧

Twitter bootstrap 引导模式被推到右侧,twitter-bootstrap,ruby-on-rails-4,modal-dialog,Twitter Bootstrap,Ruby On Rails 4,Modal Dialog,使用rails 4应用程序中的Bootstrap 3,我使用以下命令调用模态: <a href="#myModal" data-target="#myModal" role="button" data-toggle="modal"><span class="glyphicon glyphicon-plus"></span> New Listing</a> <!-- Modal --> <div class="

使用rails 4应用程序中的Bootstrap 3,我使用以下命令调用模态:

  <a href="#myModal" data-target="#myModal" role="button" data-toggle="modal"><span class="glyphicon glyphicon-plus"></span> New Listing</a>

    <!-- 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="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">Hey, wait a second!</h4>
          </div>
          <div class="modal-body">
            In order to blah blah...!
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
            <%= link_to "Sign Out", destroy_user_session_path, type: "button" , class: "btn btn-primary" , method: :delete %>
          </div>
        </div><!-- /.modal-content -->
      </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
我尝试将位置更改为绝对,但这并不能解决问题


有记录吗?

原来这是一个CSS问题。我正在使用Bootswatch中的bootstrap主题。在用标准引导代码覆盖引导样例的模态CSS元素之后,所有这些都被修复了。谢谢。

您的网格布局是如何构造的?你能检查一下它是否正确吗?我想可能是有什么错误把你的模态框弄乱了,因为它的代码似乎是正确的,我不确定我是否完全理解。我使用这个模式的一个地方(有问题)是导航栏。这不应该受到网格布局的影响,对吗?导航栏也在网格布局内,请检查是否;否则,您可能会重新定义一些共享类。似乎奇怪的行为为我的无知道歉-对发展中国家来说是新的。你能详细说明我是如何检查网格布局的吗。我假设这只适用于利用bootstrap的网格渲染()的区域。非常感谢你的帮助。
.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  display: none;
  overflow: auto;
  overflow-y: scroll;
}