从Dropbox导入字体
我正在尝试使用Drobox托管的字体。
看来所有字体都存储在邮政编码中的Dropbox中,因为您可以看到Bellow
我的问题是:是否可以在托管这样的HTML页面字体中导入?如果可能的话,如何?
我尝试使用 @font-face和@import而没有成功
<!DOCTYPE html>
<html>
<head>
<title>Web Font Sample</title>
<style type="text/css">
@font-face {
font-family: 'Cera-Pro-Medium';
src: url('https://www.dropbox.com/sh/g5xuhd#####x69r8/AAD#######EOa'),
}
.classname {
font-family: 'Cera-Pro-Medium';
}
</style>
</head>
<body>
<div class="classname">
test
</div>
</body>
</html>
I am trying to use fonts hosted in drobox.
It seems that all fonts are stored in Dropbox in a zip as you can see bellow
My question is : Is it possible to import in an HTML page fonts hosted like that? and if it is possible how?
I tried using @font-face and @import without success
<!DOCTYPE html>
<html>
<head>
<title>Web Font Sample</title>
<style type="text/css">
@font-face {
font-family: 'Cera-Pro-Medium';
src: url('https://www.dropbox.com/sh/g5xuhd#####x69r8/AAD#######EOa'),
}
.classname {
font-family: 'Cera-Pro-Medium';
}
</style>
</head>
<body>
<div class="classname">
test
</div>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作为一个迟到一年的人,是的;但不在zip文件中,只需制作一个文件夹并将这些文件放入文件夹中,然后只需复制链接并将主要域替换为dl.dropboxusercontent.com并忽略背面,然后就可以了,然后继续将链接粘贴到@font中-face src(别忘了为字体家庭命名字体)
as a guy that was late for a year, Yes; but not in zip file, just make a folder and put those files in the folder, then just copy link and replace the main domain to dl.dropboxusercontent.com and ignore the back, there you go, proceed to paste the link in @font-face src (don't forget to name your font for font-family)