+ 1
btn:nth-child(1) means
- Select every <button> element that is the first child of its parent.
The buttons are not siblings they don't share the same parents.
The first button in your html is the third child of its parent: <body>
The second button in your html is the first child of it parent:<div>
To get the first button to include the "Start Game" try 3
+ 2
Enzo Wong [Active] No probs š, I'm glad I could help.
+ 1
Try
btn:nth-child(1):after(3) to access the first button
+ 1
Just curious why not just put the text on the button? <button> Start game </button>
Since both buttons have the same class, why do you need nth If you're just going to style them the same anyway?