Css 使用非官方引导模式修改后,引导模式页脚底部不需要的空间

Css 使用非官方引导模式修改后,引导模式页脚底部不需要的空间,css,twitter-bootstrap,Css,Twitter Bootstrap,我使用移动设备上的引导模式作为一些新代码的基础: bootstrap responsive.css .modal { position: fixed; top: 3%; right: 3%; left: 3%; bottom:3%; width: auto; margin: 0; } .modal-body { height: 60%; } .modal-body { max-height: 350px

我使用移动设备上的引导模式作为一些新代码的基础:

bootstrap responsive.css

.modal { 
    position: fixed; 
    top: 3%; 
    right: 3%; 
    left: 3%;
    bottom:3%; 
    width: auto; 
    margin: 0; 
}
.modal-body { 
    height: 60%; 
}
.modal-body { 
    max-height: 350px; 
    padding: 15px; 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; 
 }
bootstrap.css

.modal { 
    position: fixed; 
    top: 3%; 
    right: 3%; 
    left: 3%;
    bottom:3%; 
    width: auto; 
    margin: 0; 
}
.modal-body { 
    height: 60%; 
}
.modal-body { 
    max-height: 350px; 
    padding: 15px; 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; 
 }
问题是我在模态的底部有额外的空间

如何删除此空间

我做了一个演示,说明了这个问题

请尝试将浏览器的高度更改为480。当我移除
中的
底部:3%
时,模态页脚应该贴在底部,但它不是。模态
一切看起来都很好,但是
的高度。模态
与屏幕高度重叠,并且它没有响应移除填充底部:

.modal-body { 
    max-height: 350px; 
    padding: 15px;
    padding-bottom: 0;
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; 
 }
卸下底部衬垫:

.modal-body { 
    max-height: 350px; 
    padding: 15px;
    padding-bottom: 0;
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; 
 }

您可以检查方向是否为横向,并相应地最小化模态体的大小

@media only screen 
and (orientation : landscape) { 
  .modal-body { 
        height: 160px;  
    }
}

哦,顺便说一下:

在小提琴中,我还通过添加类修复了模型的圆角:

.modal-footer
{
    border-radius: 0 0 4px 4px;
}

您可以检查方向是否为横向,并相应地最小化模态体的大小

@media only screen 
and (orientation : landscape) { 
  .modal-body { 
        height: 160px;  
    }
}

哦,顺便说一下:

在小提琴中,我还通过添加类修复了模型的圆角:

.modal-footer
{
    border-radius: 0 0 4px 4px;
}

我检查了代码,如果你试着注释模式的底部属性,我想这就是你要找的

.modal { 
    position: fixed; 
    top: 3%; 
    right: 3%; 
    left: 3%;
    /*bottom:3%;*/  /* if u comment this the issue gets resolved */ 
    width: auto; 
    margin: 0; 
}
还可以更改模式页脚css,使其采用与模式相同的圆角

.modal-footer
{
    border-radius: 0 0 3px 3px;
}

我检查了代码,如果你试着注释模式的底部属性,我想这就是你要找的

.modal { 
    position: fixed; 
    top: 3%; 
    right: 3%; 
    left: 3%;
    /*bottom:3%;*/  /* if u comment this the issue gets resolved */ 
    width: auto; 
    margin: 0; 
}
还可以更改模式页脚css,使其采用与模式相同的圆角

.modal-footer
{
    border-radius: 0 0 3px 3px;
}

我相信你的问题是你在模态中的形式。 把这个放到你的CSS里

.modal form{ margin: 0 !important;}

我相信你的问题是你在模态中的形式。 把这个放到你的CSS里

.modal form{ margin: 0 !important;}

你能发布你的HTML/制作一个JSFIDLE吗?尝试底部:0;在您自己的样式表中删除.modal body css中的padding属性必须创建fiddle您可以发布HTML/生成JSFIDLE吗?尝试底部:0;在您自己的样式表中,删除.modal body css中的padding属性已创建了fiddle。但如果我在移动横向模式下查看站点,我看不到页脚。仅在设备上测试过。。工作完美。但我应该添加什么,以便在平板电脑设备上modal body的高度不是160px。在小型设备上也有问题。无法看到页脚按钮。高度较小的设备。除了定向之外,您还可以针对具有媒体查询的大型/小型设备。这里有一个链接,其中包含每个设备的许多媒体查询示例:另请查看此片段:以上链接应足以处理平板电脑/小型设备。。。如果没有,请告诉我,我会用示例更新我的答案准备好了。但是如果我在移动横向模式下查看网站,我看不到页脚。只是在设备上测试过。。工作完美。但我应该添加什么,以便在平板电脑设备上modal body的高度不是160px。在小型设备上也有问题。无法看到页脚按钮。高度较小的设备。除了定向之外,您还可以针对具有媒体查询的大型/小型设备。这里有一个链接,其中包含每个设备的许多媒体查询示例:另请查看此片段:以上链接应足以处理平板电脑/小型设备。。。如果没有,请告诉我,我会用例子更新我的答案