Css 为什么不是';我的字体没有加载吗?

Css 为什么不是';我的字体没有加载吗?,css,fonts,font-face,Css,Fonts,Font Face,我刚得到一个名为Cubano rummar的甜美字体,这是我第一次使用@font face。我不确定我是否做对了,但我的代码是: @font-face { font-family: 'CubanoRegular'; src: url('...fonts/cubano-regular-webfont.eot'); src: url('...fonts/cubano-regular-webfont.eot')format('embedded-opentype'), url(

我刚得到一个名为Cubano rummar的甜美字体,这是我第一次使用@font face。我不确定我是否做对了,但我的代码是:

@font-face {
  font-family: 'CubanoRegular';
  src: url('...fonts/cubano-regular-webfont.eot');
  src: url('...fonts/cubano-regular-webfont.eot')format('embedded-opentype'),
       url('...fonts/cubano-regular-webfont.woff') format('woff'),
       url('...fonts/cubano-regular-webfont.ttf') format('truetype'),
       url('...fonts/cubano-regular-webfont.svg#')format('svg'); 

我是个新手,如果有人能帮上忙,那就太棒了

您的路径不正确

src: url('.../fonts/cubano-regular-webfont.eot');

那么问题是您没有正确指定相对路径

试一试

希望这能解决你的问题

请记住:

=当前目录 ../=上面的一个目录

所以在下面的树结构中

index.html
  -some-folder
    -other.html
从other.html到index.html的相对路径是“./index.html”

希望这有意义


祝你好运

检查文件路径并指定文件权限,谁和什么可以读、写、修改和访问它们,更改为777。

检查文件路径。。/font或
/font
你能发布你的目录结构吗?
index.html
  -some-folder
    -other.html