I have the following HTML and am trying to make the header row of the table bold.
<!DOCTYPE html>
<html>
<head>
<style>
table>tr>th {
font-weight: bold;
}
</style>
</head>
<body>
<table>
<tr>
<th>Amount</th>
<th>Name</th>
</tr>
<tr>
<td>5</td>
<td>orange</td>
</tr>
</table>
</body>
</html>
It does not work with this rule, but if I use table tr > th
, it works. Why is that? From my understanding it should work because the <tr>
is a direkt child of the <table>
and the <th>
is a direct child of the <tr>
. What did I get wrong here?