Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unwanted outline or border around button when clicked

Tags:

I have a styled button on my website. But when I click it, it creates an unwanted border or outline (I don't know which). How can I remove that border? Below is all the code that pertains to the button.

button {      border: hidden;      cursor: pointer;      outline: none;  }
<button>this is my button</button>
like image 993
Web_Designer Avatar asked Dec 24 '10 04:12

Web_Designer


People also ask

How do I remove the button focus outline?

To remove focus around the button outline:none property is used. Outline property: Outline is an element property which draws a line around element but outside the border. It does not take space from the width of an element like border.

How do you hide the outline of a button?

Show activity on this post. So use border: none; and that annoying blue border shall disappear!

How do I remove the border after clicking a link?

Just add a:visited { outline: none; } in your style file.

What is button outline?

The outline button style removes all background images or colors from a button and gives it a lighter look. The outline style buttons can be used for various purposes, for example: Indicating the secondary action complementing the primary action.


1 Answers

Use either of these CSS Styles

a:active, a:focus, input, input:active, input:focus {     outline: 0;     outline-style:none;     outline-width:0; }   a:active, a:focus, button::-moz-focus-inner, input[type="reset"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner, input[type="submit"]::-moz-focus-inner, input[type="file"] > input[type="button"]::-moz-focus-inner {     border: none; }  

OR

:focus {outline:none;} ::-moz-focus-inner {border:0;} 

Once the CSS Style part is done, then you might also need to set the IE-Emulator. Update your web applications web.config file and include below key.

<system.webServer>   <httpProtocol>     <customHeaders>       <clear />       <add name="X-UA-Compatible" value="IE=7; IE=9; IE=8; IE=5;" />     </customHeaders>   </httpProtocol>  </system.webServer> 
like image 139
VIP Avatar answered Sep 21 '22 15:09

VIP