【问题标题】:Hiding border inside iframe隐藏 iframe 内的边框
【发布时间】:2012-10-19 06:36:31
【问题描述】:

我添加了 YouTube 订阅按钮:

<iframe src="http://www.youtube.com/subscribe_widget?p=XYZ" 
   style="overflow: hidden; height: 105px; width: 300px; border: 0;" 
   scrolling="no" frameBorder="0">
</iframe>

This site has a live example

iframe 包含我想删除的边框。我取得成功的唯一方法是为每一边创建一个 div 并掩盖边界。还有其他解决方案吗?

【问题讨论】:

    标签: html css wordpress iframe


    【解决方案1】:

    您可以将该 iframe 放入容器中并隐藏该容器的溢出,这将证明您隐藏边框的简单方法:

    ​.container{height:100px;width:295px;overflow:hidden;}
    iframe{position:relative;left:-2px;top:-2px;}
    

    ​ 概念证明:http://jsfiddle.net/hillsons/3KYp9/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-02
      • 1970-01-01
      • 2016-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-24
      相关资源
      最近更新 更多