简体   繁体   English

<iframe>边框去除,使用包含在文件中的内联脚本

[英]<iframe> Border removing, using inline script which is included within file

we have index.html in which second.html is included using iframe, Now, as we see the iframe border in index.html我们有 index.html,其中使用 iframe 包含了 second.html,现在,正如我们在 index.html 中看到的 iframe 边框

Requirement here is we need to write inline script in second.html , so that while rendering second.html in index.html, it'll remove iframe border.这里的要求是我们需要在 second.html 中编写内联脚本,以便在 index.html 中渲染 second.html 时,它会删除 iframe 边框。 we are not allowed to make any changes in that page where iframe included ie index.html我们不允许在包含 iframe 的页面中进行任何更改,即 index.html

 <div class="external">
    <iframe src="/folder/second.html" width="100%" height="700"></iframe>
</div>

please suggest me the approach to remove iframe border using the file which is included in html using iframe Sample Image:请建议我使用 iframe 示例图像使用包含在 html 中的文件删除 iframe 边框的方法:

在此处输入图片说明

将此添加到您的代码中

  <iframe src="/folder/second.html" style="border:none;"height:700px;width:100%"><iframe>

Iframe is used to show other content in our web page. iframe 用于在我们的网页中显示其他内容。 You can show videos,images and other web pages in Iframes.您可以在 iframe 中显示视频、图像和其他网页。

You cannot make any changes in renderer for security reasons.出于安全原因,您不能在渲染器中进行任何更改。

If that happened....then,如果发生这种情况……那么,

scripts, styles and all parts of both web pages will mix and will change design and functioning of both pages两个网页的脚本、样式和所有部分都将混合并改变两个页面的设计和功能

You cannot change border of iframe from second.html .您不能从second.html更改 iframe 的second.html You should make changes in index.html :您应该在index.html进行更改:

<iframe style="border:0;"></iframe>

However you can make changes in some rendering pages of iframe但是您可以在 iframe 的某些渲染页面中进行更改

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM