+ 8

Need help with css thing.[solved]

Here is my code: https://code.sololearn.com/Wt967Hyu7Vv1/?ref=app If I change at CSS line 38 from: #result button To: #continue it is not working, and I don't know why.

22nd Apr 2019, 9:46 AM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
7 odpowiedzi
+ 4
I tried using both id and class and cannot style your button, https://code.sololearn.com/W44eHUzv3cko/?ref=app So I looked at the JS of your click function. At line 24, you are doing this : id("result").innerHTML="<p>You Survived!<br>Player "+shot+" died.</p><br><br><button onclick=replay()>Continue</button>" Because you are rewriting the children without giving it an id or class, that's why your #continue does not point to the button when it appears. You can add the attribute in your JS line 24, by using ' (because you used " for string here)
22nd Apr 2019, 10:57 AM
Gordon
Gordon - avatar
+ 9
Winfred Kofi Aidoo p{color:#ffffff;}
25th Apr 2019, 7:18 AM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
+ 8
Gordon when I change it , the size of the continue/replay button is smaller.
22nd Apr 2019, 10:43 AM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
+ 7
Gordon ahh... That is why. I only looked at css and html . I never imagined it could be an problem in JS. Thank you.😁
22nd Apr 2019, 10:58 AM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
+ 1
It works when I change the selector as your have indicated.
22nd Apr 2019, 10:41 AM
Gordon
Gordon - avatar
+ 1
Interesting. % should be % of parent elements, when it is used in width / height. When % is used in font, this is the first time I see such usage.
22nd Apr 2019, 10:50 AM
Gordon
Gordon - avatar
+ 1
Need help answer, how to make text white. p{ ;FFFF}
25th Apr 2019, 7:00 AM
Winfred Kofi Aidoo
Winfred Kofi Aidoo - avatar