前端小知識~~關於css3新增知識~~歸納總結

來源:互聯網
上載者:User

標籤:

1.新增選取器

 E:nth-last-child(n)  E:nth-of-type(n)  E:nth-last-of-type(n)  E:last-child  E:first-of-type  E:only-child  E:only-of-type  E:empty  E:checked  E:enabled  E:disabled  E::selection  E:not(s)


2.Font-face 特性
Font-face 可以用來載入字型樣式,而且它還能夠載入伺服器端的字型檔,讓用戶端顯示用戶端所沒有安裝的字型。


3.Word-wrap & Text-overflow 樣式
word-wrap:允許長單詞或 URL 地址換行到下一行。
text-overflow:規定當文本溢出包含元素時發生的事情。


4.文字渲染(Text-decoration)

Text-fill-color: 文字內部填充顏色

Text-stroke-color: 文字邊界填充顏色

Text-stroke-width: 文字邊界寬度

 

5.多欄版面配置(multi-column layout)

Column-count:表示布局幾列。

Column-rule:表示列與列之間的間隔條的樣式

Column-gap:表示列於列之間的間隔

6.邊框和顏色(color, border)
css3提供支援顏色和HSL的透明度、圓角



7.漸層效果(Gradient)
  線性漸層、放射狀漸層


8.陰影(Shadow)和反射(Reflect)效果
陰影製作效果:text-shadow 、box-shadow
反射:box-reflect


9.CSS3 的背景效果

* background-clip: border-box; 背景從 border 開始顯示 ;

* background-clip: padding-box; 背景從 padding 開始顯示 ;

* background-clip: content-box; 背景顯 content 地區開始顯示 ;

* background-clip: no-clip; 預設屬性,等同於 border-box;

 

“Background Origin”,用於確定背景的位置,它通常與 background-position 聯合使用

* background-origin: border-box; 從 border. 開始計算 background-position;

* background-origin: padding-box; 從 padding. 開始計算 background-position;

* background-origin: content-box; 從 content. 開始計算 background-position;


 

    “Background Size”,常用來調整背景圖片的大小,注意別和 clip 弄混,這個主要用於設定圖片本身。有以下可能的屬性:

* background-size: contain; 縮小圖片以適合元素(維持像素長寬比)

* background-size: cover; 擴充元素以填補元素(維持像素長寬比)

* background-size: 100px 100px; 縮小圖片至指定的大小 .

* background-size: 50% 100%; 縮小圖片至指定的大小,百分比是相對包 含元素的尺寸 .

 

  “Background Break”屬性,CSS3 中,元素可以被分成幾個獨立的盒子(如使內嵌元素 span 跨越多行),background-break 屬性用來控制背景怎樣在這些不同的盒子中顯示。

* background-break: continuous; 預設值。忽略盒之間的距離(也就是像元 素沒有分成多個盒子,依然是一個整體一 樣)

* background-break: bounding-box; 把盒之間的距離計算在內;

* background-break: each-box; 為每個盒子單獨重繪背景。

 

 

10.盒子模型

      一種非常靈活的布局方式,但是支援這一特性的瀏覽器並不多,目前只有 webkit 核心的新版本 safari 和 chrome 以及 gecko 核心的新版本 firefox。

11.Transitions, Transforms 和 Animation、Transitions

transition-property:用於指定過渡的性質,比如 transition-property:backgrond 就是指 backgound 參與這個過渡

transition-duration:用於指定這個過渡的期間

transition-delay:用於制定延遲過渡的時間

transition-timing-function:用於指定過渡類型,有 ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier



前端小知識~~關於css3新增知識~~歸納總結

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.