標籤:檔案 first 檔案的 位置 ati ie9 支援 css ext
屬性定義及使用說明
@font-face規則,網頁設計師再也不必使用的"web-safe"的字型之一。
字型的名稱,font - face規則:
- font-family: myFirstFont;
字型檔包含在您的伺服器上的某個地方,參考CSS:
- src: url(‘Sansation_Light.ttf‘)
如果字型檔是在不同的位置,請使用完整的URL:
- src: url(‘http://www.w3cschool.css/css3/Sansation_Light.ttf‘)
@font-face{font-family: myFirstFont;src: url(‘Sansation_Bold.ttf‘), url(‘Sansation_Bold.eot‘); /* IE9+ */font-weight:bold;}
CSS3 字型描述符
下面的表格列出了能夠在 @font-face 規則中定義的所有字型描述符:
| 描述符 |
值 |
描述 |
| font-family |
name |
必需。規定字型的名稱。 |
| src |
URL |
必需。定義字型檔的 URL。 |
| font-stretch |
- normal
- condensed
- ultra-condensed
- extra-condensed
- semi-condensed
- expanded
- semi-expanded
- extra-expanded
- ultra-expanded
|
可選。定義如何展開字型。預設是 "normal"。 |
| font-style |
|
可選。定義字型的樣式。預設是 "normal"。 |
| font-weight |
- normal
- bold
- 100
- 200
- 300
- 400
- 500
- 600
- 700
- 800
- 900
|
可選。定義字型的粗細。預設是 "normal"。 |
| unicode-range |
unicode-range |
可選。定義字型支援的 UNICODE 字元範圍。預設是 "U+0-10FFFF"。 |
CSS3 @font-face屬性