铬合金
火狐
我可以做些什么来更改我的代码,使其在 Firefox 中具有 Chrome 外观?我正在使用伪元素来模仿重叠表行的外观。如果可以在不使用伪元素的情况下实现这种外观,那么这也是一个适合我的解决方案。
th:first-child, tbody td:first-child {
border-top-left-radius: 1.5rem;
}
th:last-child, tbody td:last-child {
border-top-right-radius: 1.5rem;
}
tbody, tbody td {
position: relative;
z-index: 10;
transform: scale( 1 );
background-color: #333;
}
tbody td:first-child, tfoot td:first-child {
border-bottom-left-radius: 1.5rem;
}
tbody td:last-child, tfoot td:last-child {
border-bottom-right-radius: 1.5rem;
}
tbody::before, tbody::after {
position: absolute;
z-index: -10;
top: 0; right: 0; bottom: 50%; left: 0;
background-color: #222;
content: "";
}
tbody::after {
top: 50%; right: 0; bottom: 0; left: 0;
background-color: #444;
}
tfoot {
background-color: #444;
}
<style>
html, table, p {
margin: 0;
padding: 0 !important;
color: #ddd;
}
html {
font-family: Arial;
text-align: center;
text-transform: capitalize;
}
table, th, td {
padding: 1rem;
border-spacing: 0;
}
thead {
background-color: #222;
}
th { text-transform: uppercase; }
td { border-bottom: solid #222; }
</style>
<table>
<thead>
<tr> <th><p>one</p></th><th><p>two</p></th><th><p>three</p></th> </tr>
</thead>
<tbody>
<tr> <td><p>four</p></td><td><p>five</p></td><td><p>six</p></td> </tr>
</tbody>
<tfoot>
<tr> <td><p>seven</p></td><td><p>eight</p></td><td><p>nine</p></td> </tr>
</tfoot>
</table>