How to remove border around clicked button in html?

有些话、适合烂在心里 提交于 2021-01-27 05:13:07

问题


I have recently started building a website and have started to make buttons on it. However, whenever I click the button, I get a blue border like this !

How should I get rid of this border? Thanks in advance!


回答1:


Add this css to your button:

outline: none;



回答2:


Just add :

button:focus {
    outline: none;
}



回答3:


The way to remove this is to add this to the css of the button:

outline: 0;

If you don't want that line anywhere add this to your css:

* {
    outline: 0;
}



回答4:


just add outline: none;

here's an example

#button
{
  width: 10px;
  height: 10px;
  z-index: -1;
  outline: none;
}


来源:https://stackoverflow.com/questions/22435457/how-to-remove-border-around-clicked-button-in-html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!