With previous versions of CSS, web designers had to use fonts that were already installed on the user’s computer. With CSS3, a web designer can use any font he or she likes. When you find the font file you want to use, simply include the font file inthe website and it will be automatically downloaded to the users who need it. The font you selected is in the new Your “own” font is in The number in the table represents the first browser version number that supports the property. Attribute @ font-face 4.0 9.0 3.5 3.2 10.0 Internet Explorer 9 font, Firefox, Chrome, Safari, and Opera support WOFF (Web Open Font Format) fonts. Firefox, Chrome, Safari, and Opera support Chrome, Safari and Opera also support SVG fonts / folding. Internet Explorer also supports EOT (Embedded OpenType) fonts. Note: Internet Explorer 8 and earlier versions do not support the new In the new Tip: please use lowercase letters in URL. Uppercase letters can produce unexpected results in IE. To use fonts for HTML elements, use the Example You must add another one that contains bold text Example This file “Sansation_Bold.ttf” is another font file that contains Browsers should appear in bold when using the font family “myFirstFont” of this text. So you can have many of the same fonts. The following table lists all the font descriptions and the Descriptor Value Description Font-family Name Necessary. Specifies the name of the font. Src URL Necessary. Defines the URL of the font file. Font-stretch Normal Optional. Defines how fonts are stretched. Default is “normal”. Condensed Ultra-condensed Extra-condensed Semi-condensed Expanded Semi-expanded extra-expanded Ultra-expanded Font-style Normal Optional. Defines the style of the font. Default is “normal”. Italic Oblique Font-weight Normal Optional. Defines the weight of the font. Default is “normal”. Bold 100 200 300 400 500 600 700 800 900 Unicode-range Unicode-range Optional. Defines the range of UNICODE characters supported by fonts. The default is “Ubuno-10FFFF”.
8.9.1. CSS3 @ font-face Rule ¶
CSS3
the version has information about
@font-face
rule description.
CSS3
@font-face
defined in the rules. 8.9.2. Browser support ¶
.ttf
(True Type font) and
.otf
(OpenType) font type).
@font-face
rules. 8.9.3. Use the font you need ¶
@font-face
in the rule, you must first define the name of the font (such as myFirstFont), and then point to the font file.
font-family
property to reference the name of the font (myFirstFont):<style>
@font-face
{
font-family: myFirstFont;
src: url(sansation_light.woff);
}
div
{
font-family:myFirstFont;
}
</style>
8.9.4. Use bold text ¶
@font-face
rules:@font-face
{
font-family: myFirstFont;
src: url(sansation_bold.woff);
font-weight:bold;
}
Sansation
the bold type of the font.
@font-face
the rules. 8.9.5. CSS3 font description ¶
@font-face
rule definition: