You're bumping into the crux of cascading, and the reason a lot of people avoid the wildcard selector.
The wildcard selector applies to all objects, and it isn't applying the style as an inheritance. You may assume that *{}
is really affecting the <html>
or <body>
elements, but in actually it is applying directly to all elements. Because of this, *{}
has higher specificity than an inherited style from the element's parent.
.table-dark
is a container class, because of this, you likely have <tbody>
, <tr>
, and <td>
elements between it and the content. This is stopping the <table>
element from passing its font on. Think of it like this:
body {
font-family: helvetica;
}
table {
font-family: arial;
}
<body> <!-- helvetica -->
<div> <!-- inherited helvetica -->
<table> <!-- arial -->
<tbody> <!-- inherited arial -->
<tr> <!-- inherited arial -->
<td> <!-- inherited arial -->
content <!-- inherited arial -->
</td>
</tr>
</tbody>
</table>
</div>
</body>
Here, the <body>
is passing Helvetica to the <div>
, however it is not passing it to the table, because table is defined in the CSS. However, you've assigned it to all elements, like this:
* {
font-family: helvetica;
}
table {
font-family: arial;
}
<body> <!-- helvetica -->
<div> <!-- helvetica -->
<table> <!-- arial -->
<tbody> <!-- helvetica -->
<tr> <!-- helvetica -->
<td> <!-- helvetica -->
content <!-- helvetica -->
</td>
</tr>
</tbody>
</table>
</div>
</body>