pho*_*ard 25 css ruby-on-rails ruby-on-rails-3.1
我看到在rails 3.1的开发环境中,css是按字母顺序加载的,而不是按照我想要的顺序加载.我想要一个特定的css文件在最后,所以它覆盖之前给予类的任何样式.我们怎样才能做到这一点?
小智 40
你实际上可以这样做:
/*
*= require 'reset'
*= require_self
*= require_tree .
*/
Run Code Online (Sandbox Code Playgroud)
在您的application.css文件中.这允许您在树之前指定任意数量的样式表(例如重置),而无需指定每个单独的文件.复位周围的单引号是可选的.
不试图复活一个旧线程,只是认为这可能对某些人有所帮助.
Aru*_*nan 18
最好手动指定每个文件的顺序:
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require reset
*= require groups
*= require the_last
*
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11359 次 |
| 最近记录: |