CSS的4個簡寫
2010-12-13 18:50??聶微東? 閱讀(1547)? 評論(3)??編輯??收藏
1.background 簡寫屬性在一個聲明中設置所有的背景屬性:
- background-color
- background-image
- background-repeat
- background-attachment
- background-position
例如:
background
: #444444 url(image.png) no-repeat fixed top;
2.border 簡寫屬性在一個聲明設置所有的邊框屬性:
- border-width
- border-style
- border-color
例如:
border:1px solid red;
3.font 簡寫屬性在一個聲明中設置所有字體屬性:
- font-style
- font-variant
- font-weight
- font-size/line-height
- font-family
例如:
font:italic bold 12px/20px arial,sans-serif;
4.list-style 簡寫屬性在一個聲明中設置所有的列表屬性:
- list-style-type
- list-style-position
- list-style-image
例如:
list-style:square inside url('/images/images.gif');