Home > OS >  How to remove margin from last child in this situation?
How to remove margin from last child in this situation?

Time:10-06

How can I remove for example margin from the last content__graph-item in this situatation?

<table>
 <tr>
  <td>
    <div class="content__graph-item"></div>
  </td>
   <td>
    <div class="content__graph-item"></div>
  </td>
 </tr>
</table>

CodePudding user response:

It is the td that is the last child so try

td:last-child .content__graph-item

CodePudding user response:

table tr > td:last-child .content__graph-item{
   margin:0px;
}

In this case, it is recommended to give a class name to the table.

  • Related