css自定义字体

时间:2021-02-21 00:26:29
@font-face {
font-family: 华文隶书;
src: url( ../font/STLITI.eot ); /* IE */
src: url( ../font/STLITI.ttf ) format("truetype"); /* 非IE */
}
#nav{width:30px;height:537px;display:block;font-size:18px;text-align:center;margin-left:10px;font-family:"华文隶书";padding-top:;margin-top:-13px;}

常常看到别人这样声明自定义字体:

@font-face {
font-family: 'fontNameRegular';
src: url('fontName.eot');
src: local('fontName Regular'),
local('fontName'),
url('fontName.woff') format('woff'),
url('fontName.ttf') format('truetype'),
url('fontName.svg#fontName') format('svg');
}

@font-face {
font-family: 字体名称;
src: url( 字体.eot ); /* IE */
src: url( 字体.ttf ) format("truetype"); /* 非IE */
}