Reputation: 743
I have a table. some td has palin text and some td has text inside the div.
<table class="k-selectable" role="grid" data-role="selectable">
<tbody>
<tr class="k-state-selected" role="row" aria-selected="true">
<td class="center" role="gridcell">
</td>
<td class="center" role="gridcell">
<div class="rc-sprite-td sprite-null">
</div>
</td>
<td role="gridcell">
<div class="wb-ro-changed">
24261 <span><img src="/RepairCenterWeb/Whiteboard/GetImage?IsOnHold=false&IsVoid=false"></span></div>
</td>
<td role="gridcell">
Issue 11
</td>
<td class="money" role="gridcell">
<span class="float-left rc-sprite-td sprite-null"> </span>$1,186.55
</td>
<td role="gridcell">
<div class="wb-arrival-overdue">
10/9/2013</div>
</td>
<td role="gridcell">
<div class="wb-delivery-overdue">
10/9/2013</div>
</td>
<td role="gridcell">
</td>
<td role="gridcell">
</td>
<td class="center" role="gridcell">
<div class="rc-sprite-td sprite-null">
</div>
</td>
<td class="center" role="gridcell">
<img src="/RepairCenterWeb/Whiteboard/GetImage?IsClosed=false&HasPpi=false&IsPpiVeto=false&IsPartsDeleted=false&HasPartsSupplement=false&HasLaborSupplement=false">
</td>
<td class="center" role="gridcell">
<img src="/RepairCenterWeb/Whiteboard/GetImage?HasSublet=false&SubletStatus=0&HasCriticalNote=false">
</td>
<td class="center" role="gridcell">
<div class="rc-sprite-td sprite-null">
</div>
</td>
<td role="gridcell">
<div class="center no">
No</div>
</td>
<td role="gridcell">
<div class="center ">
</div>
</td>
<td role="gridcell">
<div class="center ">
</div>
</td>
<td role="gridcell">
<div class="center no">
No</div>
</td>
<td role="gridcell">
<div class="center ">
</div>
</td>
<td role="gridcell">
s s
</td>
</tr>
</tbody>
</table>
And CSS is
.k-state-selected:hover {
color: #ffffff;
background-color: #0992eb;
border-color: #0992eb;
}
.k-state-selected td div{color: #ffffff;}
When I select any row it shows the blue background and white text. My problem is it is working fine for plain text inside and inside div text. ANy one can add text inside the span,label etc. So in this case i have to add following
.k-state-selected td label{color: #ffffff;}
.k-state-selected td span{color: #ffffff;}
Is there any way that can apply css for test inside the html control inside a td.
Upvotes: 0
Views: 613
Reputation: 328614
You could use the "any element" selector *
:
.k-state-selected td * {color: #ffffff;}
This will match only if the td
has (at least) one element as child.
Upvotes: 2