+ 1

Why is my button not working?

https://code.sololearn.com/WDI8XVFNbOmf/?ref=app when I change the #clickButton to Button it applies to all buttons and looks just fine so why does it break when I try to do only one?

28th Nov 2018, 4:37 PM
Cameron Welker
4 odpowiedzi
+ 1
Ids are used to identify individual elements in the page, so when you only select #clickButton the style is only applied to the button with id="clickButton". Putting in just button selects all elements that are called button and applies the previously mentioned style.
28th Nov 2018, 4:44 PM
TurtleShell
TurtleShell - avatar
0
TurtleShell thats not what I mean. When i apply to Button for all buttons it looks how its supposed to which is flat with text and a shadow. When I apply with #clickButton it has the flat square with the basic html button inside it
28th Nov 2018, 4:46 PM
Cameron Welker
0
Your “clickButton” id is applied to a <p> element rather than your button element in your HTML.
28th Nov 2018, 4:48 PM
Russ
Russ - avatar
0
TurtleShell I misunderstood your answer and fixed the code which you can see from the link, thanks for the help!
28th Nov 2018, 4:49 PM
Cameron Welker