Javascript 如何将bootstrap.css字体系列HTML更改为我自己下载的字体
我一直在想怎么做,至少我差点就成功了。但她/他正在使用链接更改字体 但是我使用(.eot.otf.svg.ttf.woff.woff2)下载了自己的字体 我有Javascript 如何将bootstrap.css字体系列HTML更改为我自己下载的字体,javascript,html,css,twitter-bootstrap,fonts,Javascript,Html,Css,Twitter Bootstrap,Fonts,我一直在想怎么做,至少我差点就成功了。但她/他正在使用链接更改字体 但是我使用(.eot.otf.svg.ttf.woff.woff2)下载了自己的字体 我有style.css如下: /* font converted using font-converter.net. thank you! */ @font-face { font-family: "CataneoBT-Regular"; src: url("./fonts/07323Cataneo.svg") format("svg
style.css
如下:
/* font converted using font-converter.net. thank you! */
@font-face {
font-family: "CataneoBT-Regular";
src: url("./fonts/07323Cataneo.svg") format("svg"), /* Legacy iOS */
url("./fonts/07323Cataneo.ttf") format("truetype"), /* Safari, Android, iOS */
url("./fonts/07323Cataneo.woff") format("woff"), /* Modern Browsers */
url("./fonts/07323Cataneo.woff2") format("woff2"); /* Modern Browsers */
font-weight: normal;
font-style: normal;
}
这是我的bootstrap.css html的一段代码:
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
我的引导程序最相似的代码是:
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix')
format('embedded-opentype'),
url('../fonts/glyphicons-halflings-regular.woff2')
format('woff2'),
url('../fonts/glyphicons-halflings-regular.woff')
format('woff'),
url('../fonts/glyphicons-halflings-regular.ttf')
format('truetype'),
url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular')
format('svg');
}
.glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
但据我所知,这段代码只是为了显示一些图标
我不知道如何将该代码更改为显示我自己的字体只需将以下CSS添加到CSS文件中,该CSS文件应包含在
引导后
@font-face {
font-family: <Your-font>;
src: url(<your-font-path>);
}
html, body {
font-family: <Your-font>, sans-serif; /*Specify your font name here*/
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
@font-face{
字体系列:;
src:url();
}
html,正文{
字体系列:,无衬线;/*请在此处指定您的字体名称*/
-ms文本大小调整:100%;
-webkit文本大小调整:100%;
}
在style.css文件中,如果需要链接字体系列,请在src中提供字体路径
@font-face {
font-family: 'sans-serif';
font-weight: normal;
font-style: normal;
src: url('../fonts/sans-serif.eot') format('embedded-opentype'), url('../fonts/sans-serif.woff') format('woff'), url('../fonts/sans-serif.ttf') format('truetype'), url('../fonts/sans-serif.otf') format('opentype'), url('../fonts/sans-serif.svg#sans-serif') format('svg');
}
您使用的是编译后的代码还是源代码(LESS,SASS)?您实际上不需要包含所有这些字体格式。沃夫已经够好了。本地字体本身的
@import
如何?我已经编辑了我的文章的更多细节,我可以使用@font-face
两次吗?比如@font-face\u 1
?@RedRiver作为参考检查,我想将sans-serif字体更改为我自己下载的字体,而不是相反