【规范】css

声明顺序

为了保证更好的可读性,我们应该遵循以下顺序:

  1. 定位:position | z-index | top | right | bottom | left | clip
  2. 布局:display | float | clear | visibility | overflow | overflow-x | overflow-y
  3. 尺寸:width | min-width | max-width | height | min-height | max-height
  4. 外边距:margin | margin-top | margin-right | margin-bottom | margin-left
  5. 内边距:padding | padding-top | padding-right | padding-bottom | padding-left
  6. 边框:border | border-top | border-right | border-bottom | border-left | border-radius | box-shadow | border-image
  7. 背景:background | background-color | background-image | background-repeat | background-attachment | background-position | background-origin | background-clip | background-size
  8. 颜色:color | opacity
  9. 字体:font | font-style | font-variant | font-weight | font-size | font-family
  10. 文本:text-transform | white-space | word-break | word-wrap | overflow-wrap | text-align | word-spacing | letter-spacing | text-indent | vertical-align | line-height
  11. 文本修饰:text-decoration | text-shadow
  12. 书写模式:direction | unicode-bidi | writing-mode
  13. 列表:list-style | list-style-image | list-style-position | list-style-type
  14. 表格:table-layout | border-collapse | border-spacing | caption-side | empty-cells
  15. 内容:content | counter-increment | counter-reset | quotes
  16. 用户界面:appearance | text-overflow | outline | outline-width | outline-color | outline-style | outline-offset | cursor | zoom | box-sizing | resize | user-select
  17. 多列:columns | column-width | column-count | column-gap | column-rule | column-rule-widthcolumn-rule-style | column-rule-color | column-span | column-fill | column-break-before | column-break-after | column-break-inside
  18. 伸缩盒:flex
  19. 变换,过渡,动画:transform | transition | animation
posted @ 2017-02-03 09:51  唐忆茹  阅读(115)  评论(0编辑  收藏  举报