Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[html] 第117天 frame和iframe有什么区别? #1049

Open
haizhilin2013 opened this issue Aug 10, 2019 · 3 comments
Open

[html] 第117天 frame和iframe有什么区别? #1049

haizhilin2013 opened this issue Aug 10, 2019 · 3 comments
Labels
html html

Comments

@haizhilin2013
Copy link
Collaborator

第117天 frame和iframe有什么区别?

@haizhilin2013 haizhilin2013 added the html html label Aug 10, 2019
@LinStan
Copy link

LinStan commented Aug 11, 2019

两者效果表现形式都是在页面中插入其他外部网页。
区别在于
frame 需要指定DTD Frameset 需要配合frameset使用,是整个网页的框架
iframe 无需指定DTD 可以直接使用,且使用更加灵活,是内嵌的框架

@ghost
Copy link

ghost commented Aug 11, 2019

主要区别是 frame 被放弃了。

@Konata9
Copy link

Konata9 commented Aug 11, 2019

frame 在 HTML5 中已经被废弃。现在比较推荐使用 iframe 来代替 frame
两者都可以在一个 HTML 中插入引入另一个 HTML 的文档内容。frame 必须要放在 frameset 中使用,可以想象把浏览器的窗口进行切割。而 iframe 可以想象是浏览器中又开了一个浏览器。

frame 不能脱离 frameset 使用,并且不能放在 body 中,否则不能正常显示,而 iframe 则没有这个限制。

参考文章:
【HTML 初心者入門】frame・iframe の使い方を解説!
frame,iframe,frameset 之间的关系与区别

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
html html
Projects
None yet
Development

No branches or pull requests

3 participants