How to remove the blue box shadow border in button if clicked
43,758
Solution 1
Blue shadow is browser default :focus state
.btnd:active,
.btnd:focus,
.btnd:focus:active {
background-image: none;
outline: 0;
box-shadow: none;
}
Solution 2
I deal with this problem just yesterday. You need:
.btnd:focus, .btnd:active, .btnd.active, .btnd:focus:active {
background-image: none;
outline: none;
-webkit-box-shadow: none;
box-shadow: none;
}
The key is in last selector .btnd:focus:active
.
Related videos on Youtube
Author by
user3729634
Updated on July 09, 2022Comments
-
user3729634 almost 2 years
I want to do is remove the button blue box shadow effect in my class
btnd
if the button is click.current output:
i tried this but it doesnt work.
.btnd:active, .btnd.active { background-image: none; outline: 0; -webkit-box-shadow: none; box-shadow: none; }
-
Jehanzeb.Malik almost 10 years
-
-
meteorBuzz almost 9 yearsThe .btnd:focus:active prevents the outline that appears for a split second when clicked. +1, well done
-
marcvangend about 6 yearsAlthough this answer is technically correct, I am surprised that no one has mentioned that removing the outline is not recommended for accessibility reasons. See outlinenone.com or a11yproject.com/posts/never-remove-css-outlines.