CSS3 @font-face屬性

來源:互聯網
上載者:User

標籤:檔案   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
  • ormal
  • italic
  • oblique
可選。定義字型的樣式。預設是 "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屬性

聯繫我們

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