Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap button - remove outline on Chrome OS X

I am looking to achieve this: http://getbootstrap.com/javascript/#popovers-examples - scroll to the "live Demo" and hit the red popover button, in Chrome on OS X.... It's perfect beautiful

However, in my own code it outlines blue, despite a litany of CSS efforts from me to remove this!

It looks correct in Safari and Firefox but a no go in Chrome!

like image 333
Shane Holloman Avatar asked Jan 18 '14 06:01

Shane Holloman


People also ask

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 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 I change the outline button in bootstrap?

You'll simply use the class . btn btn-outline in your HTML instead of . btn and the CSS style property border-color instead of background-color.


3 Answers

I see .btn:focus has an outline on it:

.btn:focus {
  outline: thin dotted;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}

Try changing this to:

.btn:focus {
  outline: none !important;
}

Basically, look for any instances of outline on :focused elements — that's what's causing it.

Update - For Bootstrap v4:

.btn:focus {
  box-shadow: none;
}
like image 84
Nick Heer Avatar answered Oct 18 '22 20:10

Nick Heer


For any googlers like me, where..

.btn:focus {
    outline: none;
}

still didn't work in Google Chrome, the following should completely remove any button glow.

.btn:focus,.btn:active:focus,.btn.active:focus,
.btn.focus,.btn:active.focus,.btn.active.focus {
    outline: none;
}
like image 25
shaneparsons Avatar answered Oct 18 '22 20:10

shaneparsons


.btn:focus, .btn:active:focus, .btn.active:focus{
    outline:none;
    box-shadow:none;
}

This should remove outline and box shadow

like image 36
sidhartha madipalli Avatar answered Oct 18 '22 18:10

sidhartha madipalli