I have a button that turn blue when the user holds on to it for a while sample below on mobile. Sample below
This not an issue with ::selected
or outline has i have added that and it didn't work.
The whole button turns blue for a few seconds and disappears. How do i stop the button from turning blue?
As I could infer from your problem statement, the background-color
of your button might be changing due to :active
pseudo-class acting on it which stays for few seconds of click on button and then when click is released it disappears. You may target the button:active
selector and override the behavior with the desired background-color
and color
. I have tried creating a mock of what may help you.
button{
background-color: blue;
color: #ffffff;
height: 32px;
}
/* scenario you might need to override with the background color you want to retain */
button:active{
background: darkblue;
}
<button type="submit">Trial</button>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments