2

这是我的代码

@font-face {
    font-family: 'WebSymbolsRegular';
    src: url('websymbols-regular-webfont.eot');
    src: url('websymbols-regular-webfont.eot?#iefix') format('embedded-opentype'),
        url('websymbols-regular-webfont.woff') format('woff'),
        url('websymbols-regular-webfont.ttf') format('truetype'),
        url('websymbols-regular-webfont.otf') format('opentype'),
        url('websymbols-regular-webfont.svg#WebSymbolsRegular') format('svg');
    font-weight: normal;
    font-style: normal;
}

这是我的头文件

<link rel="stylesheet" href="css/fontstylesheet.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
4

1 回答 1

0

检查字体文件路径。如果您将字体放在 css 文件夹之外的单独字体文件夹中,则意味着提到 css 中的字体包路径并尝试它工作正常..

@font-face {
    font-family: 'WebSymbolsRegular';
    src: url('../fonts/websymbols-regular-webfont.eot');
    src: url('../fonts/websymbols-regular-webfont.eot?#iefix') format('embedded-opentype'),
        url('../fonts/websymbols-regular-webfont.woff') format('woff'),
        url('../fonts/websymbols-regular-webfont.ttf') format('truetype'),
        url('../fonts/websymbols-regular-webfont.otf') format('opentype'),
        url('../fonts/websymbols-regular-webfont.svg#WebSymbolsRegular') format('svg');
    font-weight: normal;
    font-style: normal;
}
于 2014-09-10T09:38:29.563 回答