My button broke | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

My button broke

So I need some help fixing my button code. I can’t seem to figure out how to change text color with a button can someone help? https://code.sololearn.com/Wrq6m5lqF9Tz/?ref=app

29th Dec 2021, 7:27 PM
Jeffrey Montanari Jr
Jeffrey Montanari Jr - avatar
2 Answers
+ 2
You should specify color in the correct CSS block. Since you only have one button, you can put it in the "button" type block. But, if you want to use classes - button.<Class> - or IDs - button.<ID> - you have to include a class or ID in the button HTML element. If, instead, you want to change colors on a keyboard, mouse or time event, it's a completely different thing. Since you didn't explain the code intention, I'm guessing.
30th Dec 2021, 2:19 AM
Emerson Prado
Emerson Prado - avatar
+ 2
.blue is a class selector, when using button.blue you select button elements with class = blue. Add the class to the button, or the color inside the button selector
29th Dec 2021, 7:32 PM
CGM
CGM - avatar