Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove blue "selected" outline on buttons?

Tags:

css

I have some buttons using <button>, which when clicked get a blue selected color!

Is there a way to remove this feature?

like image 385
Christoffer Jacobsen Avatar asked Dec 15 '13 09:12

Christoffer Jacobsen


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!


2 Answers

That is a default behaviour of each browser; your browser seems to be Safari, in Google Chrome it is orange in color!

Use this to remove this effect:

button {   outline: none; // this one } 
like image 128
Afzaal Ahmad Zeeshan Avatar answered Oct 04 '22 00:10

Afzaal Ahmad Zeeshan


You can remove the blue outline by using outline: none.

However, I would highly recommend styling your focus states too. This is to help users who are visually impaired.

Check out: http://www.w3.org/TR/2008/REC-WCAG20-20081211/#navigation-mechanisms-focus-visible. More reading here: http://outlinenone.com

like image 23
Sam Avatar answered Oct 04 '22 01:10

Sam