通常我们在html或css中使用的字体用style/id/class声明font:"Georgia, Arial, Garamond;".这意味着首先它试图找到Georgia,如果没有找到它然后Arial继续下一个.但是,我只是想知道是否有任何方法可以通过在我的主机服务器上传来使用字体.(我已经从互联网上下载的字体)?
您可以使用将为您生成代码的Font Squirrel网站CSS.
基本上,您上传要用于网页的字体:
CSS
和必要的字体文件进行下载.看到这个工作示例!
为了更好地说明:
@font-face {
font-family: 'GiddyupWebRegular';
src: url('giddyup-webfont.eot');
src: url('giddyup-webfont.eot?#iefix') format('embedded-opentype'),
url('giddyup-webfont.woff') format('woff'),
url('giddyup-webfont.ttf') format('truetype'),
url('giddyup-webfont.svg#GiddyupWebRegular') format('svg');
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
直接访问字体发电机在这里!