避免太过特别的 class
它们是都有语义的,而且有限制
不好的:
.ducatiMonster620{...}
.nicolesDucatiMonster620{...}
推荐:
.vehicle{...}
.motorcycle{...}
避免单独的定义
id 在每个页面只能使用一次
不好的:
#myUniqueIdentifier{...}
#myUniqueIdentifier2{...}
混合使用
避免重复编码


封装
不要直接访问对象的子节点

不好的:
.inner{...}
.tr{...}
.bl{...}
推荐:
.weatherMod .inner{...}
.weatherMod .tr{...}
.weatherMod .bl{...}
译文原文:http://www.99css.com/2009/10/taming-css-selectors.html