1
 <style>
    .mapstyle {
          height: 100%;
          height: -webkit-calc(100% - 60px);
          height: -moz-calc(100% - 60px);
          height: calc(100% - 60px);
          margin-left: 300px;
     }
 </style>

<div style="margin:0 auto; position:relative; text-align: left; width: 100%;">
 <div style"width:100%;"><h1>HEADER</h1></div>
 <div style="width: 300px; position: absolute; top: 100px; left: 0;">test</div>
 <div id="map" class="mapstyle">
      <script>....
              var map = L.map('map').setView([57.3, 29.4],).setMaxBounds(bounds);
              ...//Leafletjs.com
      </script>
 </div>
</div>

css 中的函数 calc() 在 firefox 29.0.1 中不起作用,其他浏览器正在运行。

4

1 回答 1

2

更改第一个 div

position:absolute; height:100%

http://jsfiddle.net/Dxn5d/2/

于 2014-05-22T14:49:00.150 回答