相关疑难解决方法(0)

使用CSS3 calc进行较少积极的编译

我正在使用的Less编译器(OrangeBitsdotless 1.3.0.5)正在积极地进行翻译

body { width: calc(100% - 250px - 1.5em); }
Run Code Online (Sandbox Code Playgroud)

body { width: calc(-151.5%); }
Run Code Online (Sandbox Code Playgroud)

这显然是不希望的.我想知道是否有办法向Less编译器发出信号,在编译期间基本上忽略该属性.我搜索了Less文档和两个编译器的文档,但我找不到任何东西.

Less或less编译器是否支持此功能?

如果没有,是否有一个CSS扩展器呢?

css compilation css3 less css-calc

329
推荐指数
4
解决办法
12万
查看次数

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万
查看次数

Twitter Bootstrap 3 Modal with Scrollable Body

我正在从Bootstrap 2转移到Bootstrap 3.在旧版本中,我使用的是具有长内容的模态,并且当达到给定的最大高度时,模态会自动滚动.

在Bootstrap 3中,模式只是扩展以显示整个内容,我必须使用向下翻页键实际到达它的末尾并查看模态页脚中的按钮.我无法使用浏览器窗口最右侧的滚动条,因为它被背景覆盖,并且在任何情况下都不能直观地滚动模式框中的内容.

如何在bootstrap 3中实现一个模态,在达到最大高度时自动插入滚动条滚动内容?

我尝试将max height设置为模态类,如下所示:

.modal{
   max-height:80%;
}
.modal-header{
   height:15% !important;    
}
.modal-body{
   height:70%;
   overflow:auto;
}
.modal-footer{
   height:15%;
}
Run Code Online (Sandbox Code Playgroud)

但它没有按预期工作.模态窗口确实达到了最大尺寸,但它只是在那里削减了内容,甚至没有显示页脚.

谢谢你的帮助.

css modal-dialog twitter-bootstrap twitter-bootstrap-3

24
推荐指数
1
解决办法
5万
查看次数