css文件未在rails 3.1中读取 [英] css files not being read in rails 3.1
问题描述
我跟着hartl教程。第4.1.2节中,css格式化不会出现在我的视图中。我已经存储css文件在 public / stylesheets / blueprint
。 application.html.erb
编辑如下:
<%= stylesheet_link_tag'blueprint / screen',:media => 'screen'%>
<%= stylesheet_link_tag'blueprint / print',:media => 'print'%>
特别是,css的主体字体设置为sans-serif,
font-family:Helvetica Neue,Arial,Helvetica,sans-serif;
但我还是在正文中得到衬线字体。
其他是正确的(另一个评论这里和其他一些其他问题)关于将文件放在app / assets / stylesheets而不是public /,但你也可以必须从/ blueprint /和/ blueprint / src中删除ie.css文件才能正确显示(至少在我使用safari来查看它在localhost的情况下)
i'm following along with the hartl tutorial. section 4.1.2, css formatting does not appear in my views. i've stored css files in public/stylesheets/blueprint
. application.html.erb
edited as follows:
<%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %>
<%= stylesheet_link_tag 'blueprint/print', :media => 'print' %>
in particular, the css has body font set as sans-serif,
font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;
but i'm still getting a serif fonts in the body.
the others are right (another comment here and several other questions elsewhere) on putting the files in app/assets/stylesheets instead of public/, but you may also have to delete the ie.css files from /blueprint/ and /blueprint/src for things to show up correctly (at least that was the case with me using safari to look at it on localhost)
这篇关于css文件未在rails 3.1中读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!