Is there a way to keep a button’s border visible when clicked?
Currently the border is only visible on hover.
On load:
Hover:
Is there a way to keep a button’s border visible when clicked?
Currently the border is only visible on hover.
On load:
Hover:
Why not just put a border on the button to begin with?
When you say hover, you mean onMouseIn and onMouseOut, remember too that it won’t work on mobile so you will just have to use onClick on mobile devices.
Otherwise you need to have a framed element exactly the same size as the button, so that when you move the mouse over the button, with the use of onMouseIn you can show the white frame and the user can click on the button too.
Just make sure that the button is in front of the framed element otherwise you will not be able to click the button itself.
Also, simply add onMouseOut to your code too, so that when the user moves the mouse away from the button the framed element will be set to hide again.
You can also just add the framed element to be shown when the button is clicked, however if you are going to another page afterwards then it is probably pointless as the user won’t see it again.