简体   繁体   English

如何在bootstrap上执行OpenLayers地图高度100%

[英]How to do OpenLayers map height 100% on bootstrap

I want to 100% of the height. 我想100%的身高。

    <div class="container-fluid">
        <div class="row">
            <div id="map" 
              style="width: 100%; height: 300px; border: 1px solid #ccc;">
            </div>
        </div>
    </div>

working code is here . 工作代码在这里 The pixel size is worjking for height but persentage(%) size is not working. 像素大小正在考虑高度但是尺寸(%)不起作用。

You can try position fixed or absolute. 您可以尝试固定或绝对的位置。

<div id="map" 
     style="width: 100%; height: 100%; position:fixed">
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM