开发者

How to embed a resized website throught an iframe? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_如何学C

Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist

Closed 9 years ago.

Improve this question

I need to embed a website in another website ( throught an iframe I think ). I want to embed this website in this resolution: 200x150 pixel.

How can I do that ?


Just in case someone wanders in here. Solution in https://stackoverflow.com/a/11382661/605112. Same problem in different context. Set iframe to desired width and height and use CSS to scale it. May not work in all browsers.

<iframe width="1024" height="768" src="http://www.bbc.com" style="-webkit-transform:scale(0.5);-moz-transform-scale(0.5);"></iframe>


If you mean scale the website down to fit in that frame then you can't.


The website would have to be uncommonly small to fit those dimensions.

<iframe src="http://www.google.com" width=200px; height=150px;></iframe>


If you don't have access to the iframed site itself, then there's very little you can do since you can't access iframe from other domains with Javascript.

However, if you are able to change the external page, you could either pass a URL parameter or try CSS3 media queries. For the URL parameter you would simply include a secondary stylesheet if the parameter was present that changed the layout or reduced the size of the web page in some way.


It's impossible to scale entire web sites programmatically, whether in an iframe or not.

You would have to take a screen shot of the embedded page on server side, resize that and serve it as an image.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜