【发布时间】:2015-06-10 07:37:42
【问题描述】:
我使用http://www.gotealeaf.com/blog/integrating-rails-and-bootstrap-part-1 在我的 Rails 4 网站上安装 Bootstrap。 基本上,我安装了 gem:
gem 'bootstrap-sass', '~> 3.2.0'
gem 'autoprefixer-rails'
然后在我的 application.css.scss 中有:
...* defined in the other CSS/SCSS files in this directory. It is
generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*/
@import "bootstrap-sprockets";
@import "bootstrap";
/*some css code that does work.*/
除了一个障碍之外,它运行良好。在我的
的 css 文件中/*
Filters
*/
#filters{
position: relative;
}
.searchbox{
width:100px;
}
.filter{
display: inline-block;
}
然后在我看来,我有
<div id="filters">
<input type="text" class="form-control filter"/>
<input type="text" class="form-control filter"/>
</div>
但是,输入不会并排显示。如果我在输入类中删除表单控件,它确实有效。我检查了 chrome,基本上过滤器类的 display:inline-block 被引导表单控件划掉了。
我不太擅长 css,但据我所知,rails 将引导程序的 css 文件放在我的后面,这导致引导程序更加“重要”。
我看了又看,但我找不到在引导 css 之后加载我的 css 的方法(如果我什至完全了解这种混乱的根源)
希望您能提供帮助。提前致谢!
【问题讨论】:
标签: html css ruby-on-rails ruby twitter-bootstrap