Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 从IFrame中删除边框_Html_Css_Iframe_Internet Explorer 6_Noborder - Fatal编程技术网

Html 从IFrame中删除边框

Html 从IFrame中删除边框,html,css,iframe,internet-explorer-6,noborder,Html,Css,Iframe,Internet Explorer 6,Noborder,如何从嵌入web应用程序的iframe中删除边框?iframe的一个示例是: <iframe src="myURL" width="300" height="300">Browser not compatible.</iframe> 浏览器不兼容。 我希望从我页面上的内容到iframe内容的转换是无缝的,假设背景颜色是一致的。目标浏览器仅适用于IE6,不幸的是,其他浏览器的解决方案没有帮助。添加frameBorder属性(注意大写字母“B”) 所以它看起来像: <

如何从嵌入web应用程序的iframe中删除边框?iframe的一个示例是:

<iframe src="myURL" width="300" height="300">Browser not compatible.</iframe>
浏览器不兼容。

我希望从我页面上的内容到iframe内容的转换是无缝的,假设背景颜色是一致的。目标浏览器仅适用于IE6,不幸的是,其他浏览器的解决方案没有帮助。

添加
frameBorder
属性(注意大写字母“B”

所以它看起来像:

<iframe src="myURL" width="300" height="300" frameBorder="0">Browser not compatible.</iframe>
浏览器不兼容。

除了添加FrimeBrand属性之外,您还可以考虑将滚动属性设置为“否”,以防止滚动条出现。p>

<iframe src="myURL" width="300" height="300" frameBorder="0" scrolling="no">Browser not compatible. </iframe > 
浏览器不兼容。

在尝试删除IE7中的边框时发疯,我发现frameBorder属性区分大小写

必须使用大写字母B设置frameBorder属性

<iframe frameBorder="0"></iframe>

根据Dreamweaver的说法,针对特定于浏览器的问题,还添加了
frameborder=“0”hspace=“0”vspace=“0”marginheight=“0”marginwidth=“0”

<iframe src="test.html" name="banner" width="300" marginwidth="0" height="300" marginheight="0" align="top" scrolling="No" frameborder="0" hspace="0" vspace="0">Browser not compatible. </iframe>
浏览器不兼容。
根据文档,不推荐使用frameBorder,最好使用“border”CSS属性:

<iframe src="test.html" style="width: 100%; height: 400px; border: 0"></iframe>

  • 注意CSS边框属性在IE6、7或8中未达到预期效果

    • 您也可以用JavaScript这样做。它将在IE和其他浏览器中查找任何iframe元素并删除它们的边框(尽管您可以在非IE浏览器中设置“border:none;”样式,而不使用JavaScript)。即使在生成iframe并将其放在文档中(例如,以纯HTML而非JavaScript添加的iframe)之后使用,它也可以工作

      这似乎是可行的,因为IE在BOM中创建iframe之后,不是在iframe元素上创建边框,而是在iframe的内容上创建边框。($@&*#@!!!IE!!!)

      注意:如果父窗口和iframe来自同一来源(相同的域、端口、协议等),IE部分将(当然)工作。否则,脚本将在IE错误控制台中获得“拒绝访问”错误。如果发生这种情况,您唯一的选择就是在生成它之前设置它,正如其他人所指出的,或者使用非标准的frameBorder=“0”属性。(或者让IE看起来很漂亮——我目前最喜欢的选择;)

      我花了好几个小时工作到绝望的地步才弄明白

      享受。:)

      //=========================================================================
      //删除iFrame上的边框
      var iframelements=window.document.getElementsByTagName(“iframe”);
      对于(var i=0;i
      如果要放置iframe的页面的doctype是HTML5,则可以使用
      无缝
      属性,如下所示:

      <iframe src="..." seamless="seamless"></iframe>
      
      
      


      适用于Firefox;)

      我尝试了上面所有的方法,如果你不喜欢,试试下面的CSS解决了我的问题。这只是告诉浏览器不要添加任何填充或边距

      * {
        padding:0px;
        margin:0px;
       }
      

      使用HTML iframe frameborder属性

      注意:IE使用框架B顺序(cap B),否则将不起作用。但是,HTML5不支持iframe frameborder属性。因此,改用CSS

      <iframe src="http://example.org" width="200" height="200" style="border:0">
      
      
      
      您还可以使用滚动属性删除滚动

      
      
      您还可以使用无缝属性,这在HTML5中是新的。iframe标记的无缝属性仅在Opera、Chrome和Safari中受支持。当存在时,它指定iframe看起来应该是包含文档的一部分(没有边框或滚动条)。到目前为止,标签的无缝属性仅在Opera、Chrome和Safari中受支持。但在不久的将来,它将成为标准解决方案,并与所有浏览器兼容

      在样式表中添加

      {
        padding:0px;
        margin:0px;
        border: 0px
      
      }
      
      这也是一个可行的选择。

      您可以在iframe代码中使用
      style=“border:0;”
      。这是HTML5中删除边框的推荐方法


      请查看我的工具,无需编辑代码即可自定义iframe。

      添加frameBorder属性(大写字母“B”)

      浏览器不兼容。
      
      如果您使用iFrame来适应整个屏幕的宽度和高度(我假设您不是基于300x300大小),您还必须将正文边距设置为“0”,如下所示:

      <body style="margin:0px;">
      
      
      
      HTML iFrame与您的浏览器不兼容
      
      这段代码应该在HTML 4和5中都可以使用。

      还可以设置border=“0px”


      可以使用样式属性 对于HTML5,如果要删除框架的边界或任何内容,可以使用style属性。如下所示

      代码在这里

      <iframe src="demo.htm" style="border:none;"></iframe>
      
      
      
      试试看

      
      

      这将删除框架的边框。

      要删除边框,可以使用CSS border属性将其设置为none

      <iframe src="myURL" width="300" height="300" style="border: none">Browser not compatible.</iframe>
      
      浏览器不兼容。
      
      使用此

      style="border:none;
      
      例如:

      <iframe src="your.html" style="border:none;"></iframe>
      

      添加frameBorder属性,或使用边框宽度为0px;的样式;,或将边框样式设置为“无”

      使用以下3项中的任意一项:

      浏览器不兼容。
      浏览器不兼容。
      
      浏览器不兼容。
      它很简单,只需在iframe标记frameborder=0中添加属性即可

      
      您的浏览器不支持iFrame

      (或) 您的浏览器 不支持iFrame。 HTML5不支持frameborder属性。使用CSS 相反
      1.通过内联样式集边框:0

       <iframe src="display_file.html" style="height: 400px; width:
         100%;border: 0;">HTML iFrame is not compatible with your browser
         </iframe>
      
      <iframe src="display_file.html" width="300" height="300" frameborder="0">Browser not compatible.</iframe>
      
      HTML iFrame与您的浏览器不兼容
      
      2。通过标记属性frameBorder集0<
      <iframe src="demo.htm" style="border:none;"></iframe>
      
      <iframe src="url" style="border:none;"></iframe>
      
      <iframe src="myURL" width="300" height="300" style="border: none">Browser not compatible.</iframe>
      
      style="border:none;
      
      <iframe src="your.html" style="border:none;"></iframe>
      
      <iframe src="URL" frameborder="0" width="100%" height="200">
      <p>Your browser does not support iframes.</p>
      </iframe>
      
      <iframe frameborder="1|0">
      
      (OR)
      
      <iframe src="URL" width="100%" height="300" style="border: none">Your browser 
      does not support iframes.</iframe>
      
      The <iframe> frameborder attribute is not supported in HTML5. Use CSS 
      instead.
      
       <iframe src="display_file.html" style="height: 400px; width:
         100%;border: 0;">HTML iFrame is not compatible with your browser
         </iframe>
      
      <iframe src="display_file.html" width="300" height="300" frameborder="0">Browser not compatible.</iframe>
      
      <iframe src="display_file.html" class="no_border_iframe">
          HTML iFrame is not compatible with your browser 
      </iframe>
      
      <style>
      .no_border_iframe{
      border: 0; /* or border:none; */
      }
      </style>