Html 将 iframe 嵌入博主

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17435930/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 10:42:08  来源:igfitidea点击:

embed iframe into blogger

htmliframeembedblogger

提问by user2537371

I'm having real problems embedding an iframe into my blogger site. I must confess I don't understand any html and have been attempting to copy bits of code I've found from around the web. I want to embed a friends blog into my own, and need to crop it so that it looks neater. His blog has a fixed width but dynamic height as he adds more posts. I've been defining the height of the iframe to be really large so as to make sure it will always fit in his posts no matter how large. The problem with this is that when you click a photo in his blog, it appears miles off the screen, and you have to scroll down loads to find it.

我在将 iframe 嵌入我的博客网站时遇到了真正的问题。我必须承认我不懂任何 html,并且一直试图复制我从网上找到的一些代码。我想将一个朋友的博客嵌入到我自己的博客中,并且需要对其进行裁剪以使其看起来更整洁。他的博客有固定的宽度,但随着他添加更多帖子而动态高度。我一直将 iframe 的高度定义为非常大,以确保无论多大,它始终适合他的帖子。这样做的问题是,当您单击他博客中的照片时,它会出现在屏幕几英里之外,您必须向下滚动加载才能找到它。

Here is my test blog - damianp1.blogspot.co.uk the page in question is test.

这是我的测试博客 - damianp1.blogspot.co.uk 有问题的页面是测试。

Here is the code I've used:

这是我使用的代码:

<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>

Is a solution to fit the iframe into a scroll-box so that any images clicked on would appear in the middle of this? How do I do this, or is there another solution?

是否有将 iframe 放入滚动框的解决方案,以便点击的任何图像都会出现在其中?我该怎么做,还是有其他解决方案?

Many thanks, Damian.

非常感谢,达米安。

回答by dreamweaver

Is there a reason why you want to display his entire webpage? Why not just display an RSS feed of his website?

你有什么理由要显示他的整个网页吗?为什么不只显示他网站的 RSS 提要?

Otherwise you may want to set your iframe up like this, but if the website you are using the iframe on is larger than your site in width or height you will need scrolling on or open the iframe just as large as the website contained in the iframe:

否则,您可能希望像这样设置 iframe,但如果您使用 iframe 的网站的宽度或高度大于您的网站,您将需要滚动或打开与 iframe 中包含的网站一样大的 iframe :

<iframe width="100%" frameborder="0" src="The blog URL Goes here" height="400"></iframe>

There is this handy little tool for adding blog iframes to blogger: http://www.makingdifferent.com/online-iframe-generator-tool-for-blogwebsite/

有这个方便的小工具可以将博客 iframe 添加到博主:http: //www.makingdifferent.com/online-iframe-generator-tool-for-blogwebsite/