I'm struggling to get a map, which is embedded via an iframe on a WordPress page, to show responsively on full height of the screen, independent of the device: http://www.svalbox.no/map.
Full height means, the bottom of the map should not extend beyond the screen, i.e. the user should not have to scroll down to see the full app. The upper limit is obviously the navigation bar.
In the WP page editor, I included the following HTML/CSS (taken from various sources):
<style>
.embed-container {
position: relative;
height: 0; min-height:550px;
padding-bottom: calc(60rem + 10px);
max-width: 100%;
}
.embed-container iframe, .embed-container object, .embed-container iframe{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
small{
position: absolute;
z-index: 40;
bottom: 0;
margin-bottom: -15px;
}
</style>
<div class="embed-container">
<small><a>href="http://unis78.maps.arcgis.com/apps/webappviewer/index.html?id=68c88c8c310a4c42bccd6ec41dbc04ea" style="color:#0000FF;text-align:left" target="_blank">View larger map</a></small>
<br>
<iframe width="940" height="500" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" title="Svalbox" src="http://unis78.maps.arcgis.com/apps/webappviewer/index.html?id=68c88c8c310a4c42bccd6ec41dbc04ea"></iframe>
</div>
It works for the width, which adapts to the viewport size. Whatever I try though (setting various height: 100%
) doesn't work: either nothing happens or the whole map app shrinks to 40px... I know some HTML/CSS, but this one bugs me obnoxiously since hours..
Any help is appreciated.
Thanks Nils