我有一个刚刚部署到9倍的Rails 4应用程序。样式表或字体均未呈现。
在我的资产文件夹中 layout/fonts/*all-my-font-files
然后在“ social.css.scss”中,我有:
@import '/layout/fonts';
@font-face {
font-family: 'Mono Social Icons Font';
src: asset_url('MonoSocialIconsFont-1.10.eot');
src: asset_url('MonoSocialIconsFont-1.10.eot?#iefix') format('embedded-opentype'),
asset_url('MonoSocialIconsFont-1.10.woff') format('woff'),
asset_url('MonoSocialIconsFont-1.10.ttf') format('truetype'),
asset_url('MonoSocialIconsFont-1.10.svg#MonoSocialIconsFont') format('svg');
src: asset_url('MonoSocialIconsFont-1.10.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
这样对吗?
而不是asset_url
使用font-url
您不需要这个: @import '/layout/fonts';
就像这样:
@font-face {
font-family: 'Mono Social Icons Font';
src: font-url('MonoSocialIconsFont-1.10.eot');
src: font-url('MonoSocialIconsFont-1.10.eot?#iefix') format('embedded-opentype'),
font-url('MonoSocialIconsFont-1.10.woff') format('woff'),
font-url('MonoSocialIconsFont-1.10.ttf') format('truetype'),
font-url('MonoSocialIconsFont-1.10.svg#MonoSocialIconsFont') format('svg');
src: font-url('MonoSocialIconsFont-1.10.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句