Im trying to map the googlemap map between the header and footer as the main content, but the map gets 100% and pushes the footer down, I want the map to be between them so that when the window is resized, all contents will automatically change without the left panel appearing for scroll through the content, but something is missing me, please can someone help me?
<html> <head> <style type="text/css"> html, body, #map-canvas { margin: 0; padding: 0; height: 100%; } #wrapper { height: auto !important; min-height: 100%; height: 100%; position: relative; } #footer { height: 20px; position: absolute; bottom: 0; left: 0; width: 100%; } #content { padding-bottom: 20px; } </style> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script> var map; function initialize() { var mapOptions = { zoom: 8, center: new google.maps.LatLng(-34.397, 150.644), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <div id="wrapper"> <div id="header">Header added just for demonstration purposes</div> <div id="content"><div id="map-canvas"></div></div> <div id="footer">And this is my footer</div> </div> </body> </html>
Greetings and thanks in advance. Edited: here is the jsfiddle link with slight changes, but with the same problem, if you try to get: the header, map and footer in the same view, you really cannot, the scroll bar appears because the map pushes the footer: http: / /jsfiddle.net/PYaDq/197/
source share