關於CSS的常見縮寫方法執行個體講解

來源:互聯網
上載者:User

1. background 簡寫屬性在一個聲明中設定所有的背景屬性:

background-colorbackground-imagebackground-repeatbackground-attachmentbackground-position

例如:

background: #444444 urlimage.png) no-repeat fixed top;

2. border 簡寫屬性在一個聲明設定所有的邊框屬性:

border-widthborder-styleborder-color

例如:

border:1px solid red;

3. font 簡寫屬性在一個聲明中設定所有字型屬性:

font-stylefont-variantfont-weightfont-size/line-heightfont-family

例如:

font:italic bold 12px/20px arial,sans-serif;

4. list-style 簡寫屬性在一個聲明中設定所有的列表屬性:

list-style-typelist-style-positionlist-style-image

例如:

list-style:square inside url('/images/images.gif');
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.