I'm restyling a legacy app, changing only the .css behind it. In a simplified scenario I have something like this:
table {
border: 1px solid black;
}
div.name {
background-color: red;
}
div+td {
background-color: yellow;
}
<table>
<tr>
<td>
<div class='name'>Sean</div>
</td>
<td>Connery</td>
<td>1</td>
</tr>
<tr>
<td>
<div class='name'>Pierce</div>
</td>
<td>Brosnan</td>
<td>2</td>
</tr>
</table>
I'd like to find a way (with pure css) to set background color for td elements immediately after the td that contain the div with class='name'. In other words I'd like to set background color for cells with 'Connery' and 'Brosnan'.
In my example I've used the selector div + td which is obviously wrong.
Here the fiddle.