我在将iframe嵌入我的博客网站时遇到了真正的问题。我必须承认,我不懂任何html,并且一直在尝试复制我在网络上找到的一些代码。我想嵌入一个朋友的博客到我自己的,并需要裁剪它,使其看起来更整洁。他的博客有一个固定的宽度,但随着他添加更多的帖子,他的博客高度是动态的。我一直将iframe的高度定义为非常大,以确保无论多大,它都能放在他的帖子中。这样做的问题是,当你点击他博客中的一张照片时,它会出现在离屏幕很远的地方,你必须向下滚动加载才能找到它。
这是我的测试博客- damianp1.blogspot.co.uk有问题的页面是测试。
下面是我使用的代码:
<style type="text/css">
.blog-pager, .footer, .post-footer, .feed-links, #Attribution1,.comments, .sidebar
{display:none !important;}
.main-inner .columns {width: 110%;padding-left:0 !important;padding-right:0 !important;}
</style>
</b:if>
<style>]
</style>
<div class="post-outer" style="width:875px; color:#f6f6f6" >
<div id="outerdiv" style="width: 900px; overflow: hidden">
<iframe width="1300" style="position: relative; left: -205px; top: -34px" height="30000"
src="http://wildlife-ramblings.blogspot.co.uk/" scrolling="no" frameborder="0"></iframe>
</div>
</div>是否有一种解决方案可以将iframe放入滚动框中,这样点击的任何图像都会出现在滚动框的中间?我如何做到这一点,或者有其他解决方案?
非常感谢,达米安。
发布于 2013-07-03 05:31:37
你想显示他的整个网页有什么原因吗?为什么不直接显示他网站的RSS提要呢?
否则,你可能想要这样设置你的iframe,但如果你使用iframe的网站在宽度或高度上比你的网站大,你需要滚动或打开iframe,和iframe中包含的网站一样大:
<iframe width="100%" frameborder="0" src="The blog URL Goes here" height="400"></iframe>有一个方便的小工具可以将博客iframe添加到blogger中:http://www.makingdifferent.com/online-iframe-generator-tool-for-blogwebsite/
https://stackoverflow.com/questions/17435930
复制相似问题