我在我的网站上显示一个远程网页,如下所示:
<iframe src="http://www.smopething.com/index.cfm"
frameborder="0"
width="800"
scrolling="no"
height="1100">
</iframe>
我可以自定义它的大小吗?像<iframe src="etc", height=something,width=something>
???
我在我的网站上显示一个远程网页,如下所示:
<iframe src="http://www.smopething.com/index.cfm"
frameborder="0"
width="800"
scrolling="no"
height="1100">
</iframe>
我可以自定义它的大小吗?像<iframe src="etc", height=something,width=something>
???
最好的方法是:
仅对于高度/宽度,IFRAME 具有高度/宽度属性,如W3C 规范中所示。
要获得更多控制,请将其包含在iframe
一个DIV
元素中,然后使用 CSS 设置 DIV 的大小(如果您将 CSS 直接应用于 IFRAME,它可能会起作用,但我不是 100% 确定这一点)
如果你喜欢,你可以使用 CSS:
<iframe src="http://google.com" style="width:640px;height:480px;"></iframe>
或者您可以使用宽度和高度属性:
<iframe src="http://google.com" width="640" height="480"></iframe>