在我的 html 页面中,我有 3 个 div。他们的定位是:
.rightPanel1 {
position: absolute;
right: 3%;
top: 15%;
border-style: solid;
border-color: teal;
border-width: 0.5px;
padding-left: 0.5%;
padding-right: 0.5%;
padding-bottom: 0.5%;
padding-top: 0.5%;
}
.rightPanel2 {
position: absolute;
right: 3%;
} pithigoooo top: 37%;
padding-left: 0.5%;
padding-right: 0.5%;
padding-bottom: 0.5%;
border-style: dashed;
border-color: teal;
border-width: 0.5px;
padding-top : 0.5%;
padding-left: 0.5%;
padding-top: 0.5%;
}
.body {
position: absolute;
left: 3%;
right: 25%;
top: 15%;
}
现在,当浏览器最小化时,所有 div 往往会相互重叠。浏览器中不会出现滚动条,而其他网站通常会出现这种情况。我应该怎么做才能实现它?
最佳答案
你应该固定你的 body 高度和宽度。
例如:
.body {
height: 900px;
width: 1000px;
}
关于css - 最小化浏览器时需要帮助定位 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11609870/