Skip to content

Instantly share code, notes, and snippets.

@phptuts
Last active December 26, 2023 04:24
Show Gist options
  • Save phptuts/a12a05b132fff6bff0350a9cbe46d409 to your computer and use it in GitHub Desktop.
Save phptuts/a12a05b132fff6bff0350a9cbe46d409 to your computer and use it in GitHub Desktop.
Starting Point Tic Tac Toe
function App() {
return (
<>
<h1>Tic Tac Toe</h1>
<div className="board">
<div className="row">
<div className="square">X</div> <div className="square">X</div>
<div className="square">X</div>
</div>
<div className="row">
<div className="square">X</div> <div className="square">X</div>
<div className="square">X</div>
</div>
<div className="row">
<div className="square">X</div> <div className="square">X</div>
<div className="square">X</div>
</div>
</div>
</>
);
}
export default App;
h1,
h2 {
text-align: center;
font-size: 50px;
}
.board {
width: 300px;
height: 300px;
margin: 20px auto;
}
.row {
display: flex;
}
.square {
height: 100px;
width: 100px;
font-size: 75px;
text-align: center;
cursor: pointer;
}
.row:first-of-type > .square:nth-of-type(2),
.row:nth-of-type(2) > .square:nth-of-type(2),
.row:nth-of-type(3) > .square:nth-of-type(2) {
border-right: 1px solid black;
border-left: 1px solid black;
}
.row:first-of-type,
.row:nth-of-type(2) {
border-bottom: 1px solid black;
}
.new-game {
width: 300px;
height: 75px;
font-size: 30px;
display: block;
margin: 0 auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment