0
我有<%= render @inspirations %>
,這使得4點啓示:第n個孩子被瀏覽器在引導面板忽略
查看代碼
<div class="panel panel-default">
<div class="panel-body">
<%= link_to inspiration_path(inspiration) do %>
<%= inspiration.name %>
<% end %>
</div>
</div>
但我想刪除border:white
在左側爲奇數,在右側爲偶數的靈感(這樣面板觸摸屏幕的邊緣)。
我現在所擁有的用於nth-child
是由瀏覽器
CODE
.home-panels a:nth-child(odd) .panel-default {
border-left: 0px !important;
}
.home-panels a:nth-child(even) .panel-default {
border-right: 0px !important;
}
.home-panels {} .panel-default {
border: 2.5px white solid;
}
.panel-body {}
<div class="home-panels">
<div class="panel panel-default">
<div class="panel-body">
<a href="/inspirations/37-testing-to-see-border">
<div class="white-link">Testing to See Border</div>
</a>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<a href="/inspirations/36-testing-words">
<div class="white-link">Testing Words</div>
</a>
</div>
</div>
<div class="panel panel-default">
<a href="/inspirations/35">
<img class="testing-image" alt="This is a Goal-Setter & Bucket List Maker" src="/system/inspirations/images/000/000/035/original/IMG_5106.JPG?1466979374">
</a>
</div>
<div class="panel panel-default">
<a href="/inspirations/34">
<img class="testing-image" alt="This is a Goal-Setter & Bucket List Maker" src="/system/inspirations/images/000/000/034/original/IMG_5073.JPG?1466810578">
</a>
</div>