css的一些總結

來源:互聯網
上載者:User

標籤:

(給自己看的總結)

邊框樣式

1. border-width 邊框寬度 比如:1px 

2. border-color 邊框顏色 

3. border-radius 圓角邊框 比如 20px 100px/50px (斜杠後面的數字可以視為比值)

4. border-style 邊框樣式 比如 solid實線 dotted點狀線 dashed虛線 double雙實線 none無 等

 border的簡寫規則是必須要有width color style

5. border-image 邊框圖片(看成是邊框的背景就行了 使用這個的話 style無效 某些瀏覽器不支援)比如:url(xxx.jpg) 10(這個是關於映像的縮放 本來就有縮放 這個值還不太會控制)/10px(相當於寬度)

盒子陰影

1. box-shadow  盒子陰影 比如:5px(x軸位移) 5px(y軸位移)5px(blur:模糊距離) #f00(顏色)

段落樣式
1. line-height 行高 比如12px 120%

2. text-indent 首行縮排

3. text-align 對齊(不僅是文本,對象中的其它inline或inline-block元素也能夠被text- align進行對齊的設定)比如:center

4. letter-spacing 文本之間的間距 比如:5px

5. text-overflow 溢出設定(特指文本)比如:clip(溢出裁剪)或者這三個聯動使用overflow: hidden(隱藏); white-space: nowrap(強制一行顯示);text-overflow: ellipsis(溢出部分替換為...);

6. word-wrap 段落換行(把值設定為break-word可以單詞內部自行斷行) 比如:normal(不斷行)

背景篇

1. background-color 背景顏色 比如:#f00 或rgba(255,0,0,1)r紅 g綠 b藍 a透明度(1~0)和 linear-gradient :漸層顏色(to left(方向 也可以寫45deg 等是指度), red 30%(分界線),blue)

2. background-image 背景圖片 比如:url(1.jpg)

3. background-repeat 背景圖片平鋪方式 比如:repeat平鋪 no-repeat不平鋪 repeat-x水平平鋪 repeat-y垂直平鋪

4. background-position 背景定位 比如:left bottom 30%(x軸) 20px(y軸)

5. background-origin 背景原點 比如:border-box從邊框開始 padding-box從內邊距開始 content-box從內容開始

6. background-size 背景尺寸 比如:30px 或120%

7.background-attachment:背景是否跟隨捲軸滾動 比如:scroll 預設 fixed不隨捲軸滾動

 background的簡寫規則是顏色 圖片 平鋪 定位 (多重背景用逗號隔開)

 

css的一些總結

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.