【问题标题】:embed iframe into blogger将 iframe 嵌入博客
【发布时间】:2017-08-18 15:10:13
【问题描述】:

我在将 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 放入滚动框,以便单击的任何图像都会出现在滚动框的中间?我该怎么做,或者有其他解决方案吗?

非常感谢,达米安。

【问题讨论】:

    标签: html iframe embed blogger


    【解决方案1】:

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

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

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

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

    【讨论】:

    • 谢谢。我首先尝试了 RSS 提要,但我们想显示整个博客。我觉得它看起来不错...damianp1.blogspot.co.uk/p/test_6572.html 但是在 iframe 下方挂着一个淡蓝色的盒子,我想摆脱它 - 我找不到它的 id/class 名称。我希望能够将 iframe 放入模板的原始框中,但不知道您是如何做到这一点的。我正在做一些 html/css 教程来尝试加快速度,但这很难!谢谢,达米安。
    • 谢谢!我正在寻找一种将电子表格中的谷歌图表嵌入到博客文章中的方法,并且效果很好。只需发布图表并获取其 url 以替换您的答案中的The blog URL Goes here
    猜你喜欢
    • 1970-01-01
    • 2013-07-15
    • 2023-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多