The scrolling attribute on the iframe element is o

2019-02-04 11:50发布

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?

标签: css iframe
3条回答
ゆ 、 Hurt°
2楼-- · 2019-02-04 12:32

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>
查看更多
等我变得足够好
3楼-- · 2019-02-04 12:35
<iframe style="overflow:hidden;"></iframe>
查看更多
beautiful°
4楼-- · 2019-02-04 12:46

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; 
}
查看更多
登录 后发表回答