我看到您使用一些SCSS语法而不是CSS
尝试一下:
.navbox {
border: 2px solid black;
}
.navbox th {
background-color: gray;
}
,
请检查该代码并将其实现在您的代码中,并在所需的CSS中更改颜色值。
#customers {
border-collapse: collapse;
width: 100%;
}
#customers td,#customers th {
border: 1px solid #ddd;
padding: 8px;
}
#customers tr:nth-child(even){background-color: #f2f2f2;}
#customers tr:hover {background-color: #ddd;}
#customers thead th{
background-color: gray;
}
#customers tbody th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #d7d7d7;
color: white;
}
<table id="customers">
<thead>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
</thead>
<tbody>
<tr>
<th>Alfreds Futterkiste</th>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<th>Berglunds snabbköp</th>
<td>Christina Berglund</td>
<td>Sweden</td>
</tr>
<tr>
<th>Centro comercial Moctezuma</th>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
<tr>
<th>Ernst Handel</th>
<td>Roland Mendel</td>
<td>Austria</td>
</tr>
<tr>
<th>Island Trading</th>
<td>Helen Bennett</td>
<td>UK</td>
</tr>
<tr>
<th>Königlich Essen</th>
<td>Philip Cramer</td>
<td>Germany</td>
</tr>
<tr>
<th>Laughing Bacchus Winecellars</th>
<td>Yoshi Tannamuri</td>
<td>Canada</td>
</tr>
<tr>
<th>Magazzini Alimentari Riuniti</th>
<td>Giovanni Rovelli</td>
<td>Italy</td>
</tr>
<tr>
<th>North/South</th>
<td>Simon Crowther</td>
<td>UK</td>
</tr>
<tr>
<th>Paris spécialités</th>
<td>Marie Bertrand</td>
<td>France</td>
</tr>
</tbody>
</table>
本文链接:https://www.f2er.com/3169991.html