您的位置:首页 > Web前端 > CSS

css 简写属性 规则 次序 汇总 书写顺序

2016-02-18 22:25 701 查看
简写属性顺序

1.animation 次序:-name -duration -timing-function -delay -iteration-count -direction

2.background 次序:-color -image -repeat -attachment -position

3.border 次序:-width -style -color

4.border-image 次序:-source -slice -repeat

5.font 次序:-style -variant -weight -size/line-height -family

6.list-style 次序:-type -position -image

7.columns 次序:-width -count

8.column-rule 次序:-width -style -color

9.transition 次序:-property -duration -timing-function -delay

10.margin/padding

省略的属性等同于前第二个属性值,第二个等于第一个,例如下等于上,左等于右。常见顺序为上右下左。

1px == 1px 1px 1px 1px

1px 2px == 1px 2px 1px 2px

1px 2px 3px == 1px 2px 3px 2px

css书写顺序
1.位置属性(position, top, right, z-index, display, float等)
2.大小(width, height, padding, margin)
3.文字系列(font, line-height, letter-spacing, color- text-align等)
4.背景(background, border等)
5.其他(animation, transition等)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: