I would like the google map iframe to occupy 100% of the height, as of now it is only around 150px. The coding is as shown below, what should I do, please help me.
<iframe width="67%" height="100%" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src=";amp;
source=s_q&
hl=en&
geocode=&
q=Prabhakar.C,+ICON+Design+Studio,+sathy+road,+Ganapathy,+87-A,+First+floor,+muniappakoil+thottam,,+Coimbatore,+Tamil+Nadu&aq=1&sll=21.125498,81.914063&sspn=55.331887,107.138672&
ie=UTF8&
hq=Prabhakar.C,+ICON+Design+Studio,+sathy+road,+Ganapathy,+87-A,+First+floor,+muniappakoil+thottam,,&hnear=Coimbatore,+Tamil+Nadu&t=m&
ll=11.041457,76.983948&
spn=0.080872,0.109863&
z=13&iwloc=A&
output=embed">
</iframe>
I would like the google map iframe to occupy 100% of the height, as of now it is only around 150px. The coding is as shown below, what should I do, please help me.
<iframe width="67%" height="100%" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.in/maps?f=q&
source=s_q&
hl=en&
geocode=&
q=Prabhakar.C,+ICON+Design+Studio,+sathy+road,+Ganapathy,+87-A,+First+floor,+muniappakoil+thottam,,+Coimbatore,+Tamil+Nadu&aq=1&sll=21.125498,81.914063&sspn=55.331887,107.138672&
ie=UTF8&
hq=Prabhakar.C,+ICON+Design+Studio,+sathy+road,+Ganapathy,+87-A,+First+floor,+muniappakoil+thottam,,&hnear=Coimbatore,+Tamil+Nadu&t=m&
ll=11.041457,76.983948&
spn=0.080872,0.109863&
z=13&iwloc=A&
output=embed">
</iframe>
Share
Improve this question
edited Nov 24, 2011 at 20:07
Mark Hall
54.6k9 gold badges99 silver badges114 bronze badges
asked Nov 24, 2011 at 19:55
Prashanth PalaniswamyPrashanth Palaniswamy
3522 gold badges5 silver badges15 bronze badges
3 Answers
Reset to default 10100% height can only be achieved if the parent div's height is set. If the parent div has, for example, a height of 500px, a child div with a height of 100% would have a height of 500px.
Since the iframe's parent is body
(as long as it is the only element on the page) then you have to set the height of body
to 100%:
body {
height:100%;
}
But body has a parent element too—html
. So you have to set html
's height as well:
html, body {
height:100%;
}
Then your iframe:
<iframe height="100%" src="..."></iframe>
Should stretch to the window's height.
Try adding this css.
html, body, div, iframe { margin:0; padding:0; height:100%; }
iframe { position:fixed; display:block; width:100%; border:none; }
If nothing happens you can try using javascript:
iframe = document.getElementById("frameId");
frame_height = 500;
iframe.height = frame_height;
if nothing happens, check this thread
remove the "150px" from you code and replace it with "100%"