asp.net.ph

Skip Navigation Links

@font-face Rule

CSS Attributes Index   Font Attributes


Specifies a font to embed into the HTML document.

Syntax


HTML @font-face { font-family: font-family; src: url ( strUrl ) }
Script N/A

Possible Values


font-family Any of the range of values available to the fontFamily property.
strUrl URL path to a font file.

The rule has no default value.

Remarks

This feature allows you to use specific fonts that might not be available on your local system. The URL should point to an embedded OpenType file ( .eot or .ote format ). The file contains compressed font data that is converted to a TrueType font. For more information on the font embedding feature and pointers to a tool for creating .eot files, see Font Embedding.

Example

The following example shows how to embed a font in an HTML document by referencing its source from another site.

<style>
@font-face {
   font-family: comic; src: url( "http://fonts.com/font_file.eot" );
}
</style>
. . .
<p style="font-family: comic; font-size: 18pt">
   This line uses font-face rule defined in the above style element section using 
   comic sans ms bold in 18pt.
</p>
See Also

font, font-family, font-size, font-style, font-variant, font-weight



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note