简体   繁体   English

如何缩放iframe内容(使用WYSIWYG编辑器嵌入)?

[英]How to scale iframe content (embedded using a WYSIWYG editor)?

I have this iframe code: 我有这个iframe代码:

<iframe frameborder="0" height="549" scrolling="auto" src="http://change4life.artscience.co.uk/" width="520"></iframe>

Using a Drupal - I need to embed this iframe in to a page template (using a WYSIWYG editor) that is 520 wide. 使用Drupal-我需要将此iframe嵌入到520宽的页面模板中(使用WYSIWYG编辑器)。 I know how to change the width and height but doing this doesnt actually scale the size of content within the iframe. 我知道如何更改宽度和高度,但实际上并不能缩放iframe中内容的大小。 This content is on a seperate server meaning I can not change the original content - as so is there any code out there so that I can scale the content? 此内容位于单独的服务器上,这意味着我无法更改原始内容-那里是否有任何代码可以缩放内容? Bar in mind that I am limited to inline CSS/HTML as im working within a WYSIWYG editor on the page template within a CMS. 请记住,我仅限于内联CSS / HTML,因为我在CMS的页面模板上的WYSIWYG编辑器中工作。

Hopefully there is something out there apart from zoom as that only seems to work in IE. 希望除了zoom之外还有其他东西,因为它似乎仅在IE中有效。

You can try scaling the iframe with a CSS 2D transform: https://developer.mozilla.org/en-US/docs/CSS/transform . 您可以尝试使用CSS 2D变换缩放iframe: https : //developer.mozilla.org/en-US/docs/CSS/transform Like this: 像这样:

iframe {
    transform: scale(0.5);
}

I haven't tested it, but that's the only potential thing I can think of that might work... 我还没有测试过,但这是我唯一想到的可能可行的方法...

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

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