Why do some buttons get: the focus style is applied when you click on them, and some not? For example, angular -ui modal close buttons to apply, but try the W3Schools Button Element , and it doesn’t.
EDIT: I reopen this question. Forgive me, I forgot a little about it, because I really decided that it was resolved until yesterday, when I really tried it. So I did something like this: .btn:focus:not(:active) { outline: none;} , but the problem is that then it also does not show focus when using the tab button. And generally forget about bootstrap, right?
It seems that the focus effect becomes visible when the button is pressed, when the background-color property for :focus differentiates by default. Perhaps this is true for some other properties.
So - if background is the default, you can only see the focus effect when using the tab key or manually setting it to :focus . If the background parameter is different, you can see the effect also when pressed. The plunker demonstrates this: https://plnkr.co/edit/2eKrtwl2wZcj3Ty4JJSu?p=preview
Maybe I answered my own question, maybe not, I don’t know.
edit2: Just saw @musically_ut edit, giving almost the same example.
UPDATE
After discussing with @ Error404, I can clarify the question more precisely. Therefore, the question arises: why the button outline style is not displayed when it was pressed ?
See “click” in bold because it doesn't work just when clicked. It works when it focuses on it using the keyboard keys of the tab ; it works when manually configured using the developer tools.
Basically, all the answers still claim that when he clicks, he generally loses or does not have focus, but he does. You can change the button background or border and possibly some other property, and suddenly, when you click on it, you will see a diagram. Or you can change the outline to something else in the rule :focus , and it will also show.