我想在我的rails(4.0.0)項目中使用bootstrap-sass(3.1.0.2)和sass-rails(4.0.1)。Bootstrap Sass with Rails 4
我application.css.scss文件看起來像這樣:
/*
* 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 vendor/assets/stylesheets of plugins, if any, 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 top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require font-awesome
*= require_tree .
*/
我bootstrap_and_overrides.css.scss文件是在樣式表文件夾,如下所示:
@import "bootstrap";
我有一個測試頁面設置試試這個:
<div class="container">
<h2>test terms</h2>
<h1>h1. Bootstrap heading <small>Secondary text</small></h1>
<p class="bg-primary">.dfd..</p>
<p class="bg-success">..sdfas.</p>
<p class="bg-info">..sdfs.</p>
<p class="bg-warning">.asdf..</p>
<p class="bg-danger">.adf..</p>
<p>test terms</p>
<button type="button" class="btn btn-primary">Default</button>
</div>
<button type="button" class="btn btn-info">Info</button>
當我啓動服務器並訪問該頁面時,它重新純文本沒有引導樣式的nders。
任何想法做什麼,將不勝感激。看來這裏有幾個人不使用寶石。這種方法有什麼理由嗎?非常感謝!
可否請您發佈html頁面的來源?它可能有一些信息。如果可能的話,也是佈局文件 – Muntasim
您是否運行'捆綁包'? –
您是否嘗試過在application.css.scss中需要引導程序?或者嘗試在conflig/application.rb中添加require(第二種方法,第一種方法返回錯誤) –