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

topswim · November 29, 2012 · Last by Yujing_Z replied at November 30, 2012 · 5330 hits

文件: 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.

You need to Sign in before reply, if you don't have an account, please Sign up first.