css - how to make leaflet map height variable -


in application making div of map as

<div id="map" style="height: 610px; width:100%"></div> 

but make map responsive want make height 100%, if make height: 100% not working.

how can make height variable width map can seen on device.

demo : http://jsfiddle.net/ccyp6/

if change height & width of map not map.

you need set parent elements height: 100%; first

html, body {    height: 100%; } 

demo

demo (this won't work no parent height defined)

explanation: why need that? when specify element's height in % 1st question arises is: 100% of what? default, div has height of 0px, 100% div won't work, setting parent elements height 100%; work.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -