The scrolling attribute on the iframe element is o

2019-02-04 12:18发布

问题:

I've embedded a Google map onto my website in an iframe:

<iframe src="http://www.map-generator.net/extmap.php?name=Spot&amp;address=los%20angeles%2C%20ca&amp;width=614&amp;height=244&amp;maptype=map&amp;zoom=14&amp;hl=en&amp;t=1298011905" width="614" height="244" scrolling="no"></iframe>

This is invalid, and I need to somehow pull off the scrolling aspect in CSS. How would I do this?

回答1:

<iframe style="overflow:hidden;"></iframe>


回答2:

I have found another solution which worked.

<iframe src="...." class="frame-abc" scrolling='no' ></iframe>

.frame-abc {
border:none;
overflow:hidden;
margin:0;
height:230px;
width:570px; 
}


回答3:

Late response

The only solution I found so far is setting overflow to hidden and set width, height to a parent div.

In your case:

<div style="width:614px; height:244px;">
    <iframe src="http://www.map-generator.net/extmap.php?name=Spot&amp;address=los%20angeles%2C%20ca&amp;width=614&amp;height=244&amp;maptype=map&amp;zoom=14&amp;hl=en&amp;t=1298011905"width="614" height="244" style="overflow:hidden; width:614px; height:244px;"></iframe>
</div>


标签: css iframe