提问者:小点点

CSS导入字体问题


我正在尝试从Web工具包中导入字体。代码已到位,字体已上传到服务器,但不会在现场显示。

CSS


    @font-face {
        font-family: 'gauntlet_thinregular';
        src: url('http://dharmafund.net/fonts/gauntletthin_tb-webfont.eot');
        src: url('http://dharmafund.net/fonts/gauntletthin_tb-webfont.eot?#iefix') format('embedded-opentype'),
             url('http://dharmafund.net/fonts/gauntletthin_tb-webfont.woff2') format('woff2'),
             url('http://dharmafund.net/fonts/gauntletthin_tb-webfont.woff') format('woff'),
             url('http://dharmafund.net/fonts/gauntletthin_tb-webfont.ttf') format('truetype'),
             url('http://dharmafund.net/fonts/gauntletthin_tb-webfont.svg#gauntlet_thinregular') format('svg');
        font-weight: normal;
        font-style: normal;
    }
    h1, h2, h3, h4, h5, h6 {
       font-family: 'gauntlet_thinregular'!important; 
    }

我在Wordpress安装上尝试了这段代码,它起作用了,但在我使用的另一个平台(CrowdfundHQ)上却不起作用。有什么想法吗?

网址:http://dharma-fund.crowdfundhq.com

谢谢


共1个答案

匿名用户

在将以下代码添加到.htaccess后,现在正在加载字体

<FilesMatch "\.(ttf|ttc|otf|eot|woff)$">
    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"
    </IfModule>
</FilesMatch>