简体   繁体   English

在Rails应用程序中覆盖bootstrap css

[英]Override bootstrap css in Rails app

All the css is ok but the only problem is that I can't change the default bootstrap css. 所有的CSS都可以,但唯一的问题是我无法更改默认的bootstrap css。

index.html.erb : index.html.erb

<div class="col-sm-6 no-padding"> Something </div>

_cards.scss : _cards.scss

.no-padding{
  padding: 0px !important;
}

Is there any configuration that is causing it? 是否有任何配置导致它?

The only way that works in this app is to write: 在这个应用程序中工作的唯一方法是写:

<div class="col-sm-6" style="padding: 0px;"> Something </div>

Obs.: I'm using Rails 5.0.1 and I created a new sample of rails app to test and worked like how I intended to do. Obs。:我正在使用Rails 5.0.1,我创建了一个新的rails应用程序样本,以便像我打算做的那样进行测试和工作。 So I guess that it should be some wrong configuration. 所以我想它应该是一些错误的配置。

Obs2.: all other components from '_card.scss' are also loading normally. Obs2:来自'_card.scss'的所有其他组件也正常加载。

To solve this issue we have to attempt to call on application.scss the bootstrap first (I mean, above on the list) and then we should call our private css folders after. 要解决这个问题,我们必须首先尝试调用application.scss引导程序(我的意思是,在列表上方)然后我们应该调用我们的私有css文件夹。

Thank you again for the amazing support guys. 再次感谢你们的支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM