小编Ral*_*ser的帖子

Bootstrap 3 - 根据屏幕尺寸设置模态窗口的高度

我正在尝试使用Bootstrap 3模态对话框创建一种响应式megamenu.我想将整个模态窗口的宽度和高度设置为视口的80%,同时将模态体设置为最大高度,以便不在大视口上填充整个屏幕.

我的HTML:

    <div class="modal fade">
            <div class="modal-dialog modal-megamenu">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
                        <h4 class="modal-title">Modal Mega Menu Test</h4>
                    </div>
                    <div class="modal-body">
                        <div class="row">
                            <div class="col-md-3"></div>
                            <div class="col-md-3"></div>
                            <div class="col-md-3"></div>
                            <div class="col-md-3"></div>
                        </div>
                    </div>
                </div>
                    <div class="modal-footer">
                        <button type="button" data-dismiss="modal" class="btn btn-primary">close</button>
                    </div>
             </div>
        </div>
Run Code Online (Sandbox Code Playgroud)

我的CSS:

.modal-megamenu {
    width:80%;
    height:80%;
}

.modal-body {
    max-height:500px;
    overflow:auto;
}
Run Code Online (Sandbox Code Playgroud)

这适用于宽度,但"height"参数不会给出任何结果.像这样,模态窗口的高度始终设置为max-height值.有没有人知道如何根据视口高度动态设置高度?

css jquery twitter-bootstrap

54
推荐指数
4
解决办法
11万
查看次数

Bootstrap 3:放置侧边栏,但在折叠时将其放在内容下方

我正在使用Twitter Bootstrap 3开发一个网站,我确实有两个问题:

  1. 如何在大屏幕上放置侧边栏,但在页面折叠时将其放在内容下?

这是我的结构(例如我必须放置侧边栏以便在折叠时将其放下):

    <div class="col-md-8">
      <p>This is content, and when collapsing I want it to be placed over the sidebar! </p>
    </div>
    <div class="col-md-4">
      <p>This is sidebar, and it gets down, but I would like to have it placed at the left side of the content!</p>
    </div>
Run Code Online (Sandbox Code Playgroud)

非常感谢,拉尔夫

css twitter-bootstrap

6
推荐指数
1
解决办法
2428
查看次数

标签 统计

css ×2

twitter-bootstrap ×2

jquery ×1