Rails HTML表:标签不做任何事情

时间:2016-09-28 13:29:54

标签: html ruby-on-rails

<% @user.workstations.each do |ws| %>
  <tr class="red">
    <td class="td_workstation"> <%= ws.name %> </td>
    <td class="td_workstation"> <%= ws.applications %> </td>
  </tr>
<% end %>

“红色”类应该使背景变红,但它不会做任何事情。为什么不影响行??????

.red {
  background: red;
  font-size: 60px;
}

.td_workstation, .th_workstation {
border: 1px solid #dddddd;
}

1 个答案:

答案 0 :(得分:1)

尝试将样式表更改为.red类:

tr.red td {
  background-color: red;
  border-collapse:collapse; //Throw this border-collapse in if you want to remove the white margins around each cell after you change the background.
  font-size: 60px;
}