Css to change color of form button

hi,

I want to change the color of form button from the standard theme color to make it a better user experience…
please share a CSS example.

thank you

<pre><span><style>
[data-test="app-button-view"] {
background-color: #00b703 !important;
border-color: #00b703 !important;
}
[data-test="app-button-view"]:active {
background-color: red !important;
border-color: red !important;
}
11 Likes

thanks @Robert_Petitto

1 Like

¿What If I have more than 1 button and only want to change the color of one of them? :confused:

Then each button needs to have a different style, so each button has a separate class name. With separate class names, you can change the CSS to make each individual button look how you want, but the CSS is much more vulnerable to breaking and you have to determine the class name assigned to each device and browser type.

I explain it better here.

2 Likes

Would the nth-child() approach work here? (I’m guessing no?)

No because they’re siblings, not parent/children

I tried several ways and couldn’t get it to work. I really thought :first-of-type would work but it doesn’t.

1 Like

yah, that makes sense