【发布时间】:2014-10-23 03:13:37
【问题描述】:
我正在尝试使用以下 css 对每个其他按钮执行不同的样式:
tr td:nth-child(odd) button {
background-color: red;
}
但是,每个按钮都是红色的,并且它们都具有相同的 tr td:nth-child(odd) button {} 样式。 这些按钮是在 g:each 语句中“创建”的:
<table class="table table-striped">
<g:each in="${exactMatches}">
<tr>
<td>
<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#modal${it.id}">
${it.name}
</button>
.
. more stuff that appears in modal...
.
</td>
</tr>
【问题讨论】:
标签: jquery html css css-selectors