November 2011
Intermediate to advanced
384 pages
13h 23m
English
No longer are you limited to so-called web safe fonts, the short list of fonts built into browsers and defined in HTML 4.01. CSS3 adds support for custom fonts. You can actually import your own TrueType (TTF), OpenType (OTF), and Embedded OpenType (EOT) font files into your web page:
@font-face {
font-family: MyFont;
src: url(myfont.ttf), url(myfont.eot);
}
selector { font-family: MyFont; }
@font-face uses a selector-like syntax that you can use and reuse, once for each new custom font. The font-family property assigns a proper name to the font and is used later when assigning the font with a CSS rule.
The files referenced by the src property must be stored on your web server. They will be downloaded by the web ...
Read now
Unlock full access