CSS @font | css font face
![CSS @font](https://i.imgur.com/axBPWDg.jpg)
ExampleSpecifyafontnamed"myFirstFont",andspecifytheURLwhereitcanbefound:@font-face{ font-family:myFirstFont; src:url(sansation_light.woff);}TryitYourself»[1]More"TryitYourself"examplesbelow.DefinitionandUsageWiththe@font-facerule,webdesignersdonothavetouseoneofthe"web-safe"fontsanymore.Inthe@font-faceruleyoumustfirstdefineanameforthefont(e.g.myFirstFont),andthenpointtothefontfile.TousethefontforanHTMLelement,refertothenameofthefont(myFirstFont)throughthefont-familyproperty:div{ font-family:...
![CSS @font](http://pix4.agoda.net/hotelimages/4172139/0/24097f8fc1c9959ea5062e8d6497eaad.jpg?s=800x)
Specify a font named "myFirstFont", and specify the URL where it can be found:
@font-face { font-family: myFirstFont; src: url(sansation_light.woff);}
Try it Yourself »[1]More "Try it Yourself" examples below.
Definition and UsageWith the @font-face rule, web designers do not have to use one of the "web-safe" fonts anymore.
In the @font-face rule you must first define a name for the font (e.g. myFirstFont), and then point to the font file.
To use the font for an HTML element, refer to the name of the font (myFirstFont) through the font-family property:
div { font-family: myFirstFont;}
Browser SupportThe @font-face rule is supported in Edge, Chrome, Firefox, Safari, and Opera.
The numbers in the table specifies the first browser version that fully supports the font format.
Font format TTF/OTF 9.0* 4.0 3.5 3.1 10.0 WOFF 9.0...取得本站獨家住宿推薦 15%OFF 訂房優惠
本站住宿推薦 20%OFF 訂房優惠,親子優惠,住宿折扣,限時回饋,平日促銷
@font-face - CSS | css font face
CSS 網頁字型@font | css font face
CSS @font | css font face
CSS Web Fonts | css font face
Using @font-face | css font face
CSS | css font face
css3中的@font | css font face
CSS font | css font face
CSS @font | css font face
CSS沒有極限- Web-font & icons 3連發 | css font face
![](https://i.imgur.com/axBPWDg.jpg)