将新的字体系列添加到Twitter Bootstrap [英] Adding a new font family to Twitter Bootstrap
问题描述
我怎样才能添加一个新的字体家庭Twitter的引导只是他们这样做?他们使用一种叫做woff的东西。我正在试图添加roboto浓缩到.css文件。我怎么能这样做,就像他们做的woff的事情?
@ font-face {
font-family :'开放Sans';
font-style:normal;
font-weight:400;
src:local('Open Sans'),local('OpenSans'),url(// themes.googleusercontent.com/static/fonts/opensans/v6/u-WUoqrET9fUeobQW7jkRT8E0i7KZn-EPnyo3HZu7kw.woff)格式( 'WOFF');
b
$ b $ p
$ b我到处搜索,但无法找到如何做woff的事情。 p>
解决方案创建一个新的CSS文件。调用它 custom.css
。将CSS标签中的CSS文件链接为外部CSS文件。在
@font -face {
font-family:'OpenSans';
font-style:normal;
font-weight:400;
src:local('Open Sans'),local('OpenSans'),url(// themes.googleusercontent.com/static/fonts/opensans/v6/u-WUoqrET9fUeobQW7jkRT8E0i7KZn-EPnyo3HZu7kw.woff)格式( 'WOFF');
您的 @ font-face
代码似乎缺少一些字体/文件。您可以使用 Font Squirel 来转换您的字体文件并生成相应的CSS文件。使用那个CSS文件块。
然后在你的font-family css中使用OpenSans。
$ b我希望它有助于
How can I add a new font family to twitter bootstrap just the way they do it? They use something called woff. I'm trying to add roboto condensed to the .css file. How can I do it like they do it with the woff thing?
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url("//themes.googleusercontent.com/static/fonts/opensans/v6/u-WUoqrET9fUeobQW7jkRT8E0i7KZn-EPnyo3HZu7kw.woff") format('woff');
}
I searched everywhere, but cant find how to do the woff thing.
解决方案 Create a new CSS file. Call it custom.css
. Link the CSS file inside your CSS tag as external CSS file. There add your @font-face
code as in:
@font-face {
font-family: 'OpenSans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url("//themes.googleusercontent.com/static/fonts/opensans/v6/u-WUoqrET9fUeobQW7jkRT8E0i7KZn-EPnyo3HZu7kw.woff") format('woff');
}
Your @font-face
code seems to be missing some fonts/file. You can use Font Squirel to convert your font file and generate the corresponding CSS file. Use that block of CSS file.
And then use OpenSans in your font-family css.
I hope it helps
这篇关于将新的字体系列添加到Twitter Bootstrap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!