Today I started to implement Google maps into my site, but I’ve ran into a problem, because the div with the maps provided for me can’t be put into another div?!
I use the code stated on this site and when I do something like
<div><div id="map_canvas" style="width:100%; height:100%"></div></div>
it stops working. Why? I don’t want my maps to be displayed over the whole page, I want it to be displayed in an normal div which I can restyle whenever I want…
You can style the
divmap_canvas. It doesn’t need putting inside anotherdivto do that.So for example, change your code to this:
And CSS:
UPDATE
Apparently you need to set the width & height on the parent DIVS too. I haven’t tested this yet, though try the following:
Failing that, have you tried an absolute size, rather than % as in my CSS at the top of this answer?