Felix
Felix

Reputation: 2661

Remove dotted line around clicked button

I have a div that, when clicked, the button inside of it will create an outline around it, like so:

image outline

**Code: **

.slide-arrow {
  color: #fff;
  background-color: #9E9997;
  border: none;
  padding: 16px 10px 17px 10px;
  font-size: 25px;
  opacity: 0.5;
  outline: 0;
}

.slide-arrow-right {
  position: absolute;
  top: 50%;
  right: 0%;
  transform: translate(0%, -50%);
  -ms-transform: translate(0%, -50%);
  margin-right: -1px;
  border-bottom-left-radius: 4px;
  border-top-left-radius: 4px;
}

.slide-arrow-left {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(0%, -50%);
  -ms-transform: translate(-0%, -50%);
  border-bottom-right-radius: 4px;
  border-top-right-radius: 4px;
}

.slide-arrow:hover {
  opacity: 0.7;
}

.slide-arrow:active {
  background-color: #D47C7C;
}

.slide-arrow i {
  font-size: 32px;
  outline: 0 !important;
}

.slide-arrow i:focus {
  outline: 0 !important;
}
<button class="slide-arrow slide-arrow-right" onclick="plusDivs(1)"><i class="fa fa-angle-double-right"></i></button>

I want this removed. But when applying outline: 0 !important; to just about everything, nothing seems to work. This only seems to happen in firefox.

Upvotes: 3

Views: 4976

Answers (2)

Abhishek Shah
Abhishek Shah

Reputation: 460

You can use outline: none on that tag while on button :active and :focus.

Upvotes: 0

Johannes
Johannes

Reputation: 67748

that's the focus. Among other things it is important for accessibility (it shows what element is currently selected/has been clicked), so actually you shouldn't remove it.

If you still want to remove it, add this to your stylesheet:

:focus {
  outline: none !important;
}

Upvotes: 8

Related Questions