If you try to use style="width:100%;height:100%"
on your div div, as you did by specifying a height of 100%, you will get a div map with zero height. This is because the div tries to be a percentage of the size of the <body>
, but by default it has an undefined height.
There are ways to determine the height of the screen and use this number of pixels as the height of the map div, but a simple alternative is to change the <body>
so that its height is 100% of the page. We can do this by applying style="height:100%"
both <body>
and <html>.
(we must do this for both, otherwise <body>
tries to be 100% of the height of the document, and the default value for this is undefined height.)
Reconfiguring your css values should solve your problem.
defau1t
source share