【发布时间】:2019-07-17 15:54:43
【问题描述】:
我的 html 和 body 元素下方出现了空格,我想知道是什么原因造成的。这超出了应有的范围扩展了我的页面。我有一种感觉是模态窗口造成的。我尝试设置溢出:隐藏在主体、模态容器以及它的各个子项上,但没有奏效。
这是我的 CSS:
* {
box-sizing: border-box;
}
body {
background-color: rgb(243, 243, 243);
font-family: 'Roboto', sans-serif;
}
p {
color: #444E55;
}
.container {
margin: 0 auto;
width: 95%;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: 50px;
grid-auto-rows: auto;
grid-column-gap: 10px;
grid-row-gap: 10px;
}
header {
grid-column: 1/span 3;
color: #4A4A4A
}
img {
display: block;
border-radius: 50%;
height: 100px;
}
.item {
padding: 12px;
background-color: #ffffff;
border: 1px rgb(197, 197, 197) solid;
}
.item:hover {
cursor: pointer;
}
.item > * {
pointer-events: none;
}
.card {
border-radius: 3px;
display: flex;
justify-content: flex-start;
align-items: center;
}
.text-container {
line-height: 0;
margin-left: 10px;
}
.modal-container {
position: relative;
bottom: 500px;
}
.modal {
background-color: #ffffff;
border: 1px rgb(197, 197, 197) solid;
border-radius: 3px;
padding: 50px;
margin: 0 auto;
width: 30%;
z-index: 1;
}
.box {
display: flex;
flex-direction: column;
align-items: center;
}
.box.one {
border-bottom: 1px grey solid;
}
.arrow {
display: inline-block;
position: relative;
left: 100%;
bottom: 30px;
}
.arrow:hover {
cursor: pointer;
}
.arrow > * {
pointer-events: none;
}
.fa.fa-window-close {
font-family: fontAwesome;
}
.off {
display: none;
}
.on {
display: block;
}
这是我的小提琴的链接: https://jsfiddle.net/v83zqofp/1/
我什至尝试在 body 上设置显式高度,但即使是 HTML 和 body 都小于视口高度。
是我的模态窗口创建了额外的空间还是其他什么?
【问题讨论】:
-
您需要发布minimal reproducible example 任何第三方网站的链接都不会切断它。
标签: javascript html css simplemodal