Html iframe 有什么用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4232067/
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 05:22:19  来源:igfitidea点击:

What is iframe used for?

htmliframe

提问by jagan j

What is the purpose of the iframe tag in HTML? What is it used for?

HTML 中 iframe 标签的用途是什么?它是干什么用的?

回答by Lasse Espeholt

An <iframe> is used for containing (X)HTML documents in other (X)HTML documents. This enables updates of parts of a website while the user browses, without making them reload the whole thing. (This is now largely replaced by AJAX).

<iframe> 用于在其他 (X)HTML 文档中包含 (X)HTML 文档。这可以在用户浏览时更新网站的部分内容,而无需重新加载整个内容。(这现在主要被AJAX取代)。

Also, see:

另请参阅:

http://w3schools.com/TAGS/tag_iframe.asp

http://w3schools.com/TAGS/tag_iframe.asp

http://en.wikipedia.org/wiki/HTML_element#Frames

http://en.wikipedia.org/wiki/HTML_element#Frames

回答by charly

Be careful. <iframe> tags are becoming less common.

当心。<iframe> 标签变得不那么常见了。

I wouldn't use iframes except in really specific cases, because it is nonstandard.

除非在非常特殊的情况下,否则我不会使用 iframe,因为它是非标准的。

here is the link

这是链接

However, Google images still uses <iframe> tags.

但是,Google 图片仍然使用 <iframe> 标签。