新手问题 关于修改 bootstrap 模板问题?

topswim · 2012年11月29日 · 最后由 Yujing_Z 回复于 2012年11月30日 · 5330 次阅读

文件: app/assets/stylesheets/custom.css.scss 引入@import "bootstrap"; 文件:application.html.erb <!DOCTYPE html> 。。。。。。。。。。。。。。。。。。。。。。

<%= link_to "sample app", '#', id: "logo" %> <%= yield %>

我想修改 navbar-inner 的颜色,于是在 app/assets/stylesheets/custom.css.scss 文件中加入: #navbar-inner{ background: #9c9;

} 但页面颜色未改变?但是当我把

改为 其颜色就发生变化?

本人没有学过 CSS,所以请大家指点?

文件:application.html.erb

<%= link_to "sample app", '#', id: "logo" %> <%= yield %>

文件:application.html.erb

'' <div id="navbar-inner"> <div class="container"> <%= link_to "sample app", '#', id: "logo" %>

Best practice first

Create a bootstrap_and_overrides.scss under assets and in this file

// Import Bootstrap and Override it here.
@import "bootstrap";
@import "bootstrap-responsive";

// Do whatever you want

Make sure you required this file in application.scss

Seems you didn't import css files into your global layout? I'm not sure cuz' it's just part of the code. You can always inspect css properties for a specific elements with developer tools in Chrome/Safari/Firefox.

需要 登录 后方可回复, 如果你还没有账号请 注册新账号