Search code examples
cssdictionaryopenlayers

Set openlayers map height 100%


In openlayers when am trying to set map height: 100%; the map itself not displaying. When setting height: 800px; like this its showing white space in some resolution and scroller in some resolution. So i want to do it like it can adjust height automatically. But height: 100%; not helping.

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

How do i solve this issue?


Solution

  • This is a simple solution.

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