如何使iframe可调整大小? [英] How can I make an iframe resizable?

查看:187
本文介绍了如何使iframe可调整大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有这个小组项目,我被分配到某个 iframe 可调整大小。自上周以来,我一直在阅读很多论坛帖子,我发现 iframe 本身无法调整大小。

We have this group project and I was assigned to make a certain iframe resizable. I've been reading lots of forum posts since last week, and I found out that iframe itself can't be resizable.

有没有办法让我的 iframe 可调整大小?

Is there a way to make my iframe resizable?

推荐答案

这可以在纯CSS中完成,如下所示:

This can be done in pure CSS, like so:

iframe {
  height: 300px;
  width: 300px;
  resize: both;
  overflow: auto;
}

将高度和宽度设置为您想要的最小尺寸,它似乎只是

Set the height and width to the minimum size you want, it only seems to grow, not shrink.

实例: https:// jsfiddle .net / xpeLja5t /

此技术在IE以外的所有主要浏览器中提供良好的支持

这篇关于如何使iframe可调整大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆