【发布时间】:2013-07-03 02:00:29
【问题描述】:
我创建了一个 Rails 4 示例应用程序。我添加了 twitter-bootstrap-rails gem 并使用安装程序来设置所有文件:rails generate bootstrap:install less。然后我创建了一个脚手架并迁移了数据库,并且 bootstrap.css 出现了它应该的样子。然后我手动创建了一个没有脚手架的模型/视图/控制器,并且没有在其上使用引导 css。这是我的看法:
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
</thead>
<tr>
<td>Jason</td>
<td>John</td>
</tr>
<tbody>
</tbody>
</table>
我应该有一个条纹表,但它不起作用。有任何想法吗?谢谢。
【问题讨论】:
-
你用什么浏览器?你能在浏览器上看到 style td(odd) use inspect element tool 吗?如果你能看到
.table-striped tbody > tr:nth-child(odd) > td, .table-striped tbody > tr:nth-child(odd) > th { background-color: #f9f9f9; },表示你的显示器无法分辨相邻的颜色 -
不,在检查器中我没有看到任何 Bootstrap 类。
-
你确定布局上有调用样式表吗?
标签: css ruby-on-rails twitter-bootstrap twitter-bootstrap-rails