本文介紹了如何讓傳單地圖畫布具有 100% 的高度?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
我的傳單畫布目前如下所示,高度為 700 像素:
My leaflet canvas currently looks like the following, with a 700px height:
但是我希望它的高度是 100%,以便占據整個空白區域.
However I would like its height it be 100%, in order to take the whole white space.
height:100% 在地圖畫布的 CSS 屬性中不起作用.我找到了一些解決方案,但它們只適用于谷歌地圖.
height:100% doesn't work in the CSS properties of the map canvas. I found a few solutions but they are only good for Google Maps.
是否有人有解決方案,即使它只是一種解決方法?謝謝!
Does anybody has a solution, even if it's only a workaround ? Thanks !
推薦答案
使用 height: 100%
確實有效,它只需要父容器也有大小(工作演示):
Using height: 100%
does work, it only needs the parent containers to have a size too (working demo):
html, body {
height: 100%;
}
#map {
width: 100%;
height: 100%;
}
這篇關于如何讓傳單地圖畫布具有 100% 的高度?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!