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

CSS高级技巧之代码检查及团队规范 #4

Open
hubvue opened this issue Dec 19, 2018 · 0 comments
Open

CSS高级技巧之代码检查及团队规范 #4

hubvue opened this issue Dec 19, 2018 · 0 comments
Labels
CSS Good for newcomers

Comments

@hubvue
Copy link
Owner

hubvue commented Dec 19, 2018

CSS hint标准规范

  1. 不要使用多个class选择元素,如a.foo.boo,这在ie6及以下不能正确解析
  2. 移除空的css规则,如a{}
  3. 正确的使用显示属性,如display:inline不要和width,height,float,margin,padding同时使用,display:inline-block不要和float同时使用等
  4. 避免过多的浮动,当浮动次数超过十次时,会显示警告
  5. 避免使用过多的字号,当字号声明超过十种时,显示警告
  6. 避免使用过多web字体,当使用超过五次时,显示警告
  7. 避免使用id作为样式选择器
  8. 标题元素只定义一次
  9. 使用width:100%时要小心
  10. 属性值为0时不要写单位
  11. 各浏览器专属的css属性要有规范,
    例如.foo{-moz-border-radius:5px;border-radius:5px}
  12. 避免使用看起来像正则表达式的css3选择器
  13. 遵守盒模型规则
@hubvue hubvue added the CSS Good for newcomers label Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant