我想从我的“样式”文件夹中添加一种新字体,类型为 .ttf 到页面。 将所有文本字体更改为该字体的 CSS 代码是什么?
我认为这只是语法问题,因为我知道这很好用:
body {font-family: verdana;}
那么基本上,如何将其指向我的字体文件?
最佳答案
我相信您正在寻找 font-face 支持的 src 属性
。更多知识请见网址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>
关于c# - asp.net 添加新字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11674038/