0

I have built a navigation for a mobile website, but i have noticed that when i click the bar icon it shows a square background around it, and i don't know how to eliminate that. if someone knows the answer, please let me know.

here is the website so you can see what I'm telling you: https://codepen.io/-kjh97-/full/KKmmqzo it only shows the squares in mobile.

I have tried with:

.fas:focus{
outline: none;
};

but it doesn't work.

  • Does this answer your question? [How to remove the blue highlight of button on mobile?](https://stackoverflow.com/questions/45049873/how-to-remove-the-blue-highlight-of-button-on-mobile) – Pascal K Jul 16 '21 at 22:33

2 Answers2

3

The outline you are seeing is not relative to the icon, but rather to the button. Thus, adding outline: none to your button should work.

However, the outline exists for accessibility purposes, so that removing it could cause problems for people who use the keyboard to trigger buttons, for example. If you remove the default outline, it's recommended to add a custom one, which is more suitable to your page design.

0
button {
  -webkit-tap-highlight-color: transparent;
}

This should do!

All other outline options should be enabled either to default or to a custom outline for accessibility.

Pascal K
  • 128
  • 1
  • 10