Avatar of Nur
Nur
 asked on

extra space below iframe

Hi..i have a problem with iframe where there is extra space under iframe. I try to remove it by adjusting the height but the content inside the iframe become shorter.
Here is my code:
<div style="border:1.5px solid #000;">            
 <div id="contentframe" style="position:relative; top: 0px; left: -380px;">
<iframe src="http://10.101.130.79/weathermap.html" frameborder="0" scrolling="no" width="1380" height="845" style="transform: scale(0.5);"></iframe>
</div>

i really hope somebody can help me to fix it. Thank you
Web Development

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon
Julian Hansen

That code is obviously just a snippet - can you show us the full listing (preferably a link) and a screen shot to show us what we should be looking for.
Julian Hansen

What are you trying to achieve with this line
<div id="contentframe" style="position:relative; top: 0px; left: -380px;">

Open in new window

Terry Woods

Pasting this into jsfiddle just gives a blank box. Can you provide a live example?
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Nur

ASKER
<div id="contentframe" style="position:relative; top: 0px; left: -380px;"> :i used this to control the position of my iframe
Capture1.PNG
ASKER CERTIFIED SOLUTION
Julian Hansen

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Nur

ASKER
thanks for your respond...at first,  i have to embed the whole website into the iframe and i set the width and height (width="1380" height="845") for that purpose but unluckily it produce the bigger size and i need to resize it  so that it fit the border size. That's why i used style="transform: scale(0.5);" and the website become smaller and left the white space. I want to know how to remove the extra space.

here is my jsfiddle:
https://jsfiddle.net/wcu2hzjx/2/
Julian Hansen

Yes but you are contradicting yourself in the code - first you are saying I want the width to be 1380 then you are saying make the width half that - does not make sense.

If you want your iframe to fit width wise make the width 100%

If you are going to style your iframe you must do it as an element not a class - in your css you had

.iframe
Instead of
iframe

Your <div> tags where unmatched.
You had styling in your iframe to move left.

Here is a start https://jsfiddle.net/nxxv9410/
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Nur

ASKER
Thank you for your help sir...it help me alot
Julian Hansen

Do you still require assistance on this?
If not you can close the question by selecting the answer that best fits your requirements and close the question.