asp.net添加新字体

use*_*537 3 css c# asp.net fonts

我想在我的"样式"文件夹中添加一个类型为.ttf的新字体到页面.什么是将所有文本字体更改为该字体的CSS代码?

我认为这只是语法问题,因为我知道这很好用:

body {font-family: verdana;}
Run Code Online (Sandbox Code Playgroud)

所以基本上,如何指向我的字体文件?

Hat*_*oft 5

我相信你正在寻找src attributefont-face支持.有关更多知识,请参阅网址http://www.w3.org/TR/css3-webfonts/#src-desc

<style type="text/css">
@font-face {
    font-family: "The Example Font";
    src: url(http://www.examplefonts.com/example.ttf) format("truetype");
}
div.ExampleFont { 
    font-family: "The Example Font", Verdana;
}
</style>
<div class="ExampleFont ">I am using the Example Font</div>
Run Code Online (Sandbox Code Playgroud)