css - 在 Tic Tac Toe 中绘制获胜线的最佳方法

标签 css html

我正在使用 HTML、CSS 和 Javascript 制作井字游戏。对于 9 个盒子,我使用了水平居中的表格。我希望在获胜组合上画一条直线。我应该使用 svg、canvas、div 还是其他任何东西? enter image description here

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


... 

</table>

最佳答案

我会建议 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>

关于css - 在 Tic Tac Toe 中绘制获胜线的最佳方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41297677/

相关文章:

javascript - C3js 标尺值重叠

javascript - 将 Rest API 连接到 Google Charts

html - 如何在我的导航中将我的导航链接居中

html - CSS - 段落将无法在 div 中正确显示

javascript - 未在 div 上触发调整大小事件

javascript - 我如何调整 Div 幻灯片 jquery

html - 是否可以更改超大屏幕的高度?

html - 表 : Scrollable tbody, 固定脚

html - 粘性顶部导航栏基础 6

html - 表变得太大