【问题标题】:Bootstrap modal sized incorrectly for content引导模式的内容大小不正确
【发布时间】:2015-06-15 20:12:08
【问题描述】:

我无法在我的网站上显示引导模式。模态 div 相对于模态对话框 div 太高太窄。

这是我切换模式的地方。

<footer>
    <div id="header-footer-content" class="container">
        <a href="mailto:xxx@xxx.com">Contact</a> |
        <a href="#" data-toggle="modal" data-target="#myModal">Privacy Policy</a>
    </div>
</footer>

这就是我定义模态的方式。 (请注意,模态实际上是在我的 rails 项目的部分视图中定义的,但下面的 html 是渲染后的结果。)

<div class="container>
    <div class="row">...</div>
    <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-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">Modal title</h4>
                </div>
                <div class="modal-body">
                    <p>some text</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary">Save changes</button>
                </div>
            </div>
        </div>
    </div>
</div>

我使用的是 bootstrap 网站上的示例模式,所以我不确定它为什么会这样显示。有没有人遇到过这种图形问题?

编辑:我正在使用引导程序 v3.3.4。该网站可以找到here

【问题讨论】:

  • 你有链接让我们看看吗?另外,您使用的是什么版本的 Bootstrap?
  • 已编辑!我在问题的底部添加了版本信息和站点。

标签: css twitter-bootstrap modal-dialog partials


【解决方案1】:

我认为这可能与您包裹在模态框周围的容器 div 有关。尝试删除它,也可以尝试删除它顶部的空行。

【讨论】:

  • modal 上方的 div 行实际上包含了一些内容。我只是“折叠”它,因为行内容与我的问题无关:)
猜你喜欢
  • 1970-01-01
  • 2012-06-14
  • 2014-08-08
  • 2015-06-10
  • 2021-05-09
  • 2019-08-18
  • 1970-01-01
  • 1970-01-01
  • 2015-10-23
相关资源
最近更新 更多