Compass SCSS字体-url配置问题



我正在用compass sass写一个模板,这里的font-mixin由于没有设置网页字体而产生了一些问题。我的配置文件是

http_path = "/"
css_dir = "resources/stylesheets"
sass_dir = "resources/stylesheets" 
images_dir = "resources/images"
javascripts_dir = "resources/js"

,然后使用font mixin生成的输出是

@font-face {
 font-family: "cabinregular";
src: url('resources/stylesheets/fonts/cabin-regular.eot?#iefix') format('embedded- 
opentype'), url('resources/stylesheets/fonts/cabin-regular.ttf') format('truetype'),
 url('resources/stylesheets/fonts/cabin-regular.woff') format('woff');
 } 

路径是正确的,但字体将不适用,而我运行html。但是如果我指定http路径,比如

   http_path="/somename/"

它适用。那么为什么它不会工作没有指定http_path..?

src: url("../fonts/cabin-regular?#iefix");置于主src之前使工作正常

@font-face {
  font-family: 'cabinregular';
  src: url("../fonts/cabin-regular?#iefix");
  src: url("../fonts/cabin-regular?#iefix") format("embedded-opentype"), url("../fonts/cabin-regular") format("woff"), url("../fonts/cabin-regular") format("truetype"), url("../fonts/cabin-regular.svg#cabin-regular") format("svg");
  font-weight: normal;
  font-style: normal;
}

最新更新