我新的軌道,並按照本教程https://launchschool.com/blog/integrating-rails-and-bootstrap-part-1#css_preprocessors,當我通過在最底部加入我不能覆蓋軌道引導CSS與我的自定義CSS
@import "bootstrap-sprockets"
@import "bootstrap"
得加引導的一部分application.css.sass
它一切都很好。不過,我有代碼
html, body{background:#000;color:#FFF;}
一條線,沒有被尊重。環顧四周後,我意識到,這是因爲我的應用程序文件:
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*= require custom
*/
@import "bootstrap-sprockets"
@import "bootstrap"
我明白,既然「引導」是在最底層,即然而,該網站使用,如果我將它移動到CSS頂部或任何其他地方,我得到一個錯誤頁面。有沒有另外一種方式讓我導入bootstrap或者我來覆蓋頁面?
如果您使用的是** ** SASS然後語法'HTML,身體{背景:#000;顏色:#FFF; ''不適用於一個。您也可以參考Ruby實現的[Bootstrap-SASS](https://github.com/twbs/bootstrap-sass#a-ruby-on-rails)文檔。 – vanburen
我想問你是否有更新。謝謝Fabrizio –