嘿嘿呀我的CSS字体不起作用,我不知道为什么,它几天前工作了......
这是CSS
@font-face {
font-family: 'TrajanProBold';
src: url('trajanpro-bold-webfont.eot');
src: url('trajanpro-bold-webfont.eot?#iefix') format('embedded-opentype'),
url('trajanpro-bold-webfont.woff') format('woff'),
url('trajanpro-bold-webfont.ttf') format('truetype'),
url('trajanpro-bold-webfont.svg#TrajanProBold') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'TrajanProRegular';
src: url('trajanpro-regular-webfont.eot');
src: url('trajanpro-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('trajanpro-regular-webfont.woff') format('woff'),
url('trajanpro-regular-webfont.ttf') format('truetype'),
url('trajanpro-regular-webfont.svg#TrajanProRegular') format('svg');
font-weight: normal;
font-style: normal;
}
body{
font-family:TrajanProBold;
background-color:#ebebeb;
padding:0;
margin:0;
}
和这个
<link rel="stylesheet" href="http://www.willruppelglass.com/css/slimbox2.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://www.willruppelglass.com/css/styles.css" />
任何帮助将不胜感激, J
答案 0 :(得分:1)
查看样式表(http://www.willruppelglass.com/css/styles.css),我可以看到TrajanProBold
仅适用于两个元素:
body
和input
但是,Slimbox样式表(http://www.willruppelglass.com/css/slimbox2.css)还有另一个应用于
的字体堆栈 #lbBottom
因此,Slimbox字体会覆盖TrajanProBold
字体,至少在提到的元素上。
答案 1 :(得分:0)
根据我使用自定义字体的经验,你需要''所以你应该尝试'TrajanProBold'。希望它就这么简单。
答案 2 :(得分:0)
更改
src: url('trajanpro-regular-webfont.eot');
到
src: url('trajanpro-regular-webfont.ttf');
答案 3 :(得分:0)
检查根文件夹中的.htaccess以及子目录中的.htaccess。 将以下代码应用于适当的.htaccess文件。
Order deny,allow
Deny from all
<Files ~ ".(xml|css|jpe?g|png|gif|js|svg|woff|ttf|eot|woff2)$">
Allow from all
</Files>