2 回答

TA貢獻1825條經驗 獲得超4個贊
添加作為答案以避免評論噪音:
所有#map
子元素都是絕對定位的。因此,本質上它們不在正常的文檔流中,并且不會影響#map
div 的高度。
您需要添加:
position: relative; height: 100vh (or whatever)
到你的#map
div。
然后,在您的 中#searchCheckboxContainer
添加一個z-index: 100 //could be anything but that worked
這會將框放置在地圖上方。

TA貢獻1831條經驗 獲得超4個贊
我想你需要它看起來像這樣:
在這種情況下,您需要修改以下內容:
#map {
position: relative;
height: calc(100vh - 86px); // The height of header on mobile and you need to add responsive media queries to handle it.
}
#map #searchCheckboxContainer{
position: absolute;
display: inline-table;
white-space: nowrap;
margin-top: 0;
bottom: 0;
left: 0;
top: auto;
transform: none;
background: #ffffff !important;
z-index: 2;
width: 100%;
padding: 15px;
}
#searchCheckbox .form-check-input{
position: relative;
margin-top: 0;
margin-left: 0;
}
#map #mapid{
height: 100%;
width: 100%;
position: absolute;
background-color: yellow;
z-index: 1;
}
- 2 回答
- 0 關注
- 131 瀏覽
添加回答
舉報