I’m trying to remove the margin above the first h3 element in a table (it looks really weird with a h2 element directly above it)
Is it possible to select the first h3 element?
<table>
<tbody>
<tr>
<td>
<h3>I want to select this</h3>
</td>
</tr>
<tr>
<td>
<h3>But not this</h3>
</td>
</tr>
</tbody>
</table>
I’ve tried this:
table tbody tr td:first-child h3 {
margin-top: 0em;
}
but I’m failing miserably
You need to attach
:first-childtotrinstead since everytdis the first and only child of itstr: