我正在将css集成到我的JSF2应用程序中,并且有些东西不能使用这些字体.这是我尝试的方式:
字体在WebContent/resources/fonts中(在Eclipse上.)在同一目录中我有一个stylesheet.css文件,我声明了这样的字体:
@font-face {
font-family: 'TitilliumText22LRegular';
src: url('titilliumtext22lregular-webfont.eot');
src: url('titilliumtext22lregular-webfont.eot?#iefix') format('embedded-opentype'),
url('titilliumtext22lregular-webfont.woff') format('woff'),
url('titilliumtext22lregular-webfont.ttf') format('truetype'),
url('titilliumtext22lregular-webfont.svg#TitilliumText22LRegular') format('svg');
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
我在我的应用程序的header.xhtml中连接到样式表:
<h:outputStylesheet library="fonts" name="stylesheet.css"/>
Run Code Online (Sandbox Code Playgroud)
尝试连接到此的css类元素位于resources/css中,称为style.css.班级本身:
.time {
font: 19px 'TitilliumText22LRegular';
text-transform: uppercase;
line-height: 1.8;
white-space: nowrap;
}
Run Code Online (Sandbox Code Playgroud)
总之,我可以说这应该工作.但事实并非如此.我究竟做错了什么?