@font-face@font-face*
*



Contents  *



Index  *Topic Contents
*Previous Topic: font
*Next Topic: font-family

@font-face

Description

Specifies a font to embed into your HTML document.

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.

Syntax

@font-face {font-family: font-family, src url(URL);}

Example

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

<html>
<head>
<style>
@font-face {font-family:comic; src:url(http://valid_url/some_font_file.eot);}
</style>
<title>Font embedding using @font-face</title>
</head>
<body>
<p style="font-family:comic;font-size:18pt">This line uses @font-face defined in the above style element section using comic sans ms bold in 18pt.</p>
</body>
</html>

Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.