Last active
December 26, 2023 04:24
-
-
Save phptuts/a12a05b132fff6bff0350a9cbe46d409 to your computer and use it in GitHub Desktop.
Starting Point Tic Tac Toe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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