在Tic Tac Toe中绘制获胜线的最佳方式

时间:2016-12-23 08:18:42

标签: html css html5

我正在使用HTML,CSS和Javascript制作Tic Tac Toe游戏。对于9个盒子,我使用了一个水平居中的桌子。我希望在胜利组合中划一条直线。我应该使用svg,canvas,div还是其他什么? enter image description here

<table>
<tr>
<td></td>


... 

</table>

1 个答案:

答案 0 :(得分:1)

我建议3(2个不可见的1个可见的svg)行

<svg height="210" width="500">
    <line x1="0" y1="0" x2="200" y2="200" style="stroke:rgb(255,0,0);stroke-width:2" />
</svg>