Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html CSS3字体不工作_Html_Css_Fonts - Fatal编程技术网

Html CSS3字体不工作

Html CSS3字体不工作,html,css,fonts,Html,Css,Fonts,我正试图在我的网站上使用自定义字体,但在确定如何使用字体样式导入自定义字体时遇到了一些问题 我将此作为参考: 这是我的CSS: @font-face { font-family: 'AlexBrush'; src: url('../fonts/alexbrush-regular-webfont.eot'); src: url('../fonts/alexbrush-regular-webfont.eot?#iefix') format('embedded-opentype

我正试图在我的网站上使用自定义字体,但在确定如何使用字体样式导入自定义字体时遇到了一些问题

我将此作为参考:

这是我的CSS:

@font-face {
    font-family: 'AlexBrush';
    src: url('../fonts/alexbrush-regular-webfont.eot');
    src: url('../fonts/alexbrush-regular-webfont.eot?#iefix') format('embedded-opentype'),
    src: url('../fonts/alexbrush-regular-webfont.woff2') format('woff2'),
    src: url('../fonts/alexbrush-regular-webfont.woff') format(woff),
    src: url('../fonts/alexbrush-regular-webfont.ttf') format('truetype'),
    src: url('../fonts/alexbrush-regular-webfont.svg#svgFontName') format('svg');
}
.page-heading {
margin: 0;
color: #FFFFFF;
font-size: 3.5em;
font-family: AlexBrush;
}
和我的html:

<h1 class="page-heading">Page Header</h1>

我遇到的问题是,我必须为每一行包含“src”属性,即使行之间用逗号分隔,而不是“;”

字体加载是否正确?也就是说,你有没有检查过你的开发者工具(网络选项卡)看它们是否没有给你一个错误。我看到了这么多错误的东西,这里有一个
(woff)
应该是
('woff')
你真的应该再次遵循教程,这次做得对。
font-family:AlexBrush应该是
字体系列:“AlexBrush”好的,我已经更新了代码,我仍然无法正确应用字体如果我查看开发工具的“网络”选项卡,我没有看到任何字体文件,这是否意味着找不到它们?
@font-face {
    font-family: 'AlexBrush';
    src: url('../fonts/alexbrush-regular-webfont.eot');
    src: url('../fonts/alexbrush-regular-webfont.eot?#iefix') format('embedded-opentype'),
    src: url('../fonts/alexbrush-regular-webfont.woff2') format('woff2'),
    src: url('../fonts/alexbrush-regular-webfont.woff') format('woff'),
    src: url('../fonts/alexbrush-regular-webfont.ttf') format('truetype'),
    src: url('../fonts/alexbrush-regular-webfont.svg#svgFontName') format('svg');
}