我下载了一个字体,我正在尝试在css中创建一个横幅,我需要这个字体,但它只是没有显示出来.
@font-face {
font-family: Minecrafter;
src: url("../fonts/Minecrafter_3.ttf") format('truetype');
}
#logo{
width:100%;
height:100px;
background-color: red;
text-align:center;
font-family:Minecrafter;
font-size:40px;
}
Run Code Online (Sandbox Code Playgroud)
我能以某种方式检查错误吗?我正在开发一个win8应用程序.
不同的浏览器支持不同的字体格式集,因此您需要为每个浏览器提供一组备选方案(brwoser支持.eot .woff*ttf的somw),因此您必须为您的字体提供替代src:
@font-face {
font-family: Minecrafter;
src: url("font.ttf") format('truetype');
url("font.woff") format('woff');
}
Run Code Online (Sandbox Code Playgroud)
用于转换所需格式的字体的好网站:https: //onlinefontconverter.com