【发布时间】:2015-09-02 11:50:21
【问题描述】:
我正在尝试使用 css3 设计一个棋盘,但似乎我的选择器是错误的。 Here is my JsFiddle
那么为什么我看不到线条和单元格周围设计的测试蓝色和红色边框?
html
<body>
My chess board
<table class="chess_board">
<tr class="chess_line">
<td class="chess_cell black_cell white_piece"><span>♔</span></td>
<td class="chess_cell white_cell white_piece"><span>♕</span></td>
<td class="chess_cell black_cell white_piece"><span>♖</span></td>
<td class="chess_cell white_cell white_piece"><span>♗</span> </td>
</tr>
<tr class="chess_line">
<td class="chess_cell white_cell"><span>♜</span></td>
<td class="chess_cell black_cell"><span>♝</span></td>
<td class="chess_cell white_cell"><span>♞</span></td>
<td class="chess_cell black_cell"><span>♟</span></td>
</tr>
</table>
My another chess board ... to be drawn !
</body>
css
table.chess_board > tr.chess_line {
background-color: blue;
}
table.chess_board > tr.chess_line > td.chess_cell {
border: 2px solid red;
/*
font-family: serif;
font-size: 2.3em;
width: 1.0em;
height: 1.0em;
text-align: center;
*/
}
table.chess_board > tr.chess_line > td.chess_cell > span {
position: relative;
bottom: 0.1em;
}
table.chess_board > tr.chess_line > td.white_cell {
background-color: rgb(217, 245, 2);
}
table.chess_board > tr.chess_line > td.black_cell {
background-color: rgb(89, 34, 21);
}
table.chess_board > tr.chess_line > td.white_piece {
color: rgb(179, 48, 63);
}
谁能帮忙?
【问题讨论】:
-
旁注:
>表示direct descendant of what precedes the > -
是的,我真正的意思是,只是不知道 tbody 标签
标签: css css-selectors