这是codepen,任何人都可以说为什么边框不显示?我想在不使用类的情况下实现这个https://codepen.io/javisp91/pen/PmzpLz。
我使用了nth-type并对待了……
你没有正确定义它们。请参阅以下内容 叉子 或片段:
tr td{ width:100px; height: 100px; } tr td{ border-right: 5px solid black; border-bottom: 5px solid black; } tr td:last-child{ border-right:0; } tr:last-child td{ border-bottom:0; } body{ text-align: center; } table{ margin: auto; }
<h1>Tic Tac Toe</h1> <table> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table>
的 逻辑: 强> 全部设定 tr td 右边和下边框除了最后一个边框。
tr td
tr td{ border-right: 5px solid black; border-bottom: 5px solid black; } tr td:last-child{ border-right:0; } tr:last-child td{ border-bottom:0; }
试试这个代码。
表{ 保证金:自动; border:solid //你忘了代码中的这一行把这一行放到显示边框。 }