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] 第109天 有好多网站不常用table和iframe这两个元素,知道原因吗? #1017

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

Comments

@haizhilin2013
Copy link
Collaborator

第109天 有好多网站不常用table和iframe这两个元素,知道原因吗?

@haizhilin2013 haizhilin2013 added the html html label Aug 2, 2019
@LemonSea
Copy link

LemonSea commented Aug 3, 2019

iframe对SEO不友好,table就不知道了,一直都是用div代替table

@rocky-191
Copy link

table布局可是当年很火的方案,现在基本不用了。稍微改动一下table里面的元素,就会造成重绘,会有一定的性能问题。现在的布局方案也很多了,flex,grid等。

@LinStan
Copy link

LinStan commented Aug 3, 2019

iframe
坏处:
是一个单独的容器,因此不会应用全局的CSS样式
会和网页共用域名连接池,因此可能由于iframe占用了连接数导致加载阻塞
搜索引擎爬虫不易爬取,不利于SEO
相比直接操作DOM元素,使用iframe更耗费资源
好处:
可以用其展示广告,可以避免由于添加广告而网站被爬虫拒绝收录的情况

table
坏处:
table的内容会等内部的所有内容加载完成才会显示,比基于div+css实现的表格布局加载速度慢。
会导致网页语义发生错误,不利于无障碍功能
改动内部内容会造成整个table重绘,消耗更多资源

好处:
前期广泛用于后台管理系统,由于普通的后台管理系统大多都是表格布局,基于table编程难度低
且面向内网的管理系统对性能要求没那么高

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

4 participants