2015-10-06 92 views
0
@font-face { 
font-family: 'Snell Roundhand Script'; 
src: url('../fonts/snell-roundhand-script.eot'); 
src: url('../fonts/snell-roundhand-script.eot?#iefix') format('embedded-opentype'), url('../fonts/snell-roundhand-script.woff') format('woff'), url('../fonts/snell-roundhand-script.ttf') format('truetype'), url('../fonts/snell-roundhand-script.svg#Snell Roundhand Script') format('svg'); 
} 
@font-face { 
font-family: 'Baskerville Old Face'; 
src: url('../fonts/ufonts.com_baskerville-old-face.eot'); 
src: url('../fonts/ufonts.com_baskerville-old-face.eot?#iefix') format('embedded-opentype'), url('../fonts/ufonts.com_baskerville-old-face.woff') format('woff'), url('../fonts/ufonts.com_baskerville-old-face.ttf') format('truetype'), url('../fonts/ufonts.com_baskerville-old-face.svg#Baskerville Old Face') format('svg'); 
} 

上面的代码是字体面对面代码为什么我的字体没有改变?

及I我poting的CSS我已经补充说:

.big-red-text{ 
color: #ff0000; 
font-family: Snell Roundhand Script; 
font-size: 50px; 
text-align: center; 
} 

.big-orange-text{ 
color: #ff6600; 
text-align: center; 
font-weight: 600; 
font-family: Baskerville Old Face; 

} 

有什么在这个失踪?为什么不考虑字体?所有字体都存储在根目录中的字体文件夹中。

+0

风格存储在.css文件和缓存问题? – Amarnasan

回答

0

试试这个:

.big-red-text{ 
    color: #ff0000; 
    font-family: 'Snell Roundhand Script'; 
    font-size: 50px; 
    text-align: center; 
} 
+1

使用单引号将字体系列包装起来并不起作用 –

2

如果您的字体名称包含空格,你必须圈地它在单引号。 如果名称中没有空格,可能会丢失单引号,但我建议始终使用它们来避免错误。

因此,作为Fundhor表明它会与

font-family: 'Snell Roundhand Script'; 

font-family: 'Baskerville Old Face'; 

工作,确保您的文件是在正确的地方:

- css 
-- fonts.css <-- here you are declaring your @font-face 
- fonts 
-- snell-roundhand-script.eot 
-- etc... 

另外包括你之前,你fonts.css正在使用font-family

+0

将字体系列包装在单引号中并不能解决问题 –

+0

为了便于调试,请尝试使用不包含空格的名称。 – Fundhor

+0

仍然没有任何东西,我将它从斯内尔圆形脚本更改为斯内尔和巴斯克维尔老脸巴斯克维尔相同 –

相关问题