简体   繁体   English

使网页内容适合固定大小的iframe

[英]fit webpage content on a fixed size iframe

Is there any javascript, ajax, css or any other method to get a webpage content fitted on a fixed widht iframe? 是否有任何JavaScript,ajax,css或任何其他方法可将网页内容安装到固定的iframe上? Like mobile device browser does. 就像移动设备浏览器一样。 Thank you. 谢谢。

You define a container div with a fixed width (say 400px) and set that div to overflow hidden. 您定义一个具有固定宽度(例如400像素)的容器div,并将该div设置为隐藏溢出。 That will force the content of that div to stay within the 400px width. 这将迫使该div的内容保持在400px宽度内。 You put all the content that you want to have in the iframe in that container div. 您将所有要包含在iframe中的内容放入该容器div中。 And then, you put that div inside the iframe. 然后,将该div放入iframe中。

I think that'd be the easiest way to do it. 我认为这是最简单的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM