Html 引导模式全屏问题

Html 引导模式全屏问题,html,css,twitter-bootstrap,modal-dialog,fullscreen,Html,Css,Twitter Bootstrap,Modal Dialog,Fullscreen,对于这个问题,有很多解决方案将高度和宽度分别设置为100%和100%,但这些解决方案并不考虑模式下的内容。 在我的JSFIDLE示例中,有一个错误。我错在哪里 .modal-dialog { width: 100%; height: 100%; padding: 0; margin: 0; } .modal-content { height: 100%; border-radius: 0; } 问题在于高度为100%,因为它只填充窗口高度。改为使用min height

对于这个问题,有很多解决方案将高度和宽度分别设置为100%和100%,但这些解决方案并不考虑模式下的内容。 在我的JSFIDLE示例中,有一个错误。我错在哪里

.modal-dialog {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
}

.modal-content {
  height: 100%;
  border-radius: 0;
}

问题在于高度为
100%
,因为它只填充窗口高度。改为使用
min height

.modal-dialog {
    width: 100%;
    min-height: 100%;
    padding: 0;
    margin: 0;
}

我找到了一个行之有效的解决方案


1+我只需要做一个更改,modal的左边是从我添加的屏幕中央开始的
left:0
.modal dialog
,它工作得很好,谢谢
.modal {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
}
.modal-dialog {
    position: fixed;
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}
.modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    border: none;
}
.modal-content {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    box-shadow: none;
}
.modal-body {
    position: absolute;
    top: 50px;
    bottom: 0;
    font-size: 15px;
    overflow: auto;
    margin-bottom: 60px;
    padding: 0 15px 0;
    width: 100%;
}
.modal-footer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 60px;
    padding: 10px;
    background: #f1f3f5;
}
/* to delete the scrollbar */
/*
::-webkit-scrollbar {
    -webkit-appearance: none;
    background: #f1f3f5;
    border-left: 1px solid darken(#f1f3f5, 10%);
    width: 10px;
}
::-webkit-scrollbar-thumb {
    background: darken(#f1f3f5, 20%);
}
*/