【发布时间】:2011-02-06 10:33:58
【问题描述】:
我正在使用谷歌页面速度,它告诉我我的 css 效率低下...
非常低效的规则(适用于任何页面):
* table.fancy thead td Tag key with 2 descendant selectors and Class overly qualified with tag
* table.fancy tfoot td Tag key with 2 descendant selectors and Class overly qualified with tag
css规则是
table.fancy {border: 1px solid white; padding:5px}
table.fancy td {background:#656165}
table.fancy thead td, table.fancy tfoot td {background:#767276}
我希望页眉和页脚的背景颜色与表格主体(数据表格)不同
- 这效率低下的理由是什么?
- 如何提高效率?
为了 google 的缘故,我不会给 thead 和 tfoot 添加一个类。
【问题讨论】:
标签: optimization performance css-selectors micro-optimization