Suffii
Suffii

Reputation: 5784

Remove Inner Gradient On Top of Bootstrap 3 Button when Clicked

Can you please let me know how I can remove the gradient from the Bootstrap 3 Buttons when users click on the buttons: like what is showing in the below image:

enter image description here

.btn {
  display: inline-block;
  padding: 6px 12px;
  margin-bottom: 0;
  font-size: 14px;
  font-weight: normal;
  line-height: 1.42857143;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  background-image: none;
  border: 1px solid transparent;
  border-radius: 4px;
}
.btn:focus,
.btn:active:focus,
.btn.active:focus {
  outline: thin dotted;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}
.btn:hover,
.btn:focus {
  color: #333;
  text-decoration: none;
}
.btn:active,
.btn.active {
  background-image: none;
  outline: 0;
  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
          box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
}

Upvotes: 7

Views: 7421

Answers (3)

Pir Abdul
Pir Abdul

Reputation: 2334

Set Position relative along with.

button:active {
  position: relative;
  top: -1px;
  left: -1px;
}

Upvotes: 0

Denzil
Denzil

Reputation: 123

What you want to do is remove the box-shadow when the button is in the active state (being pressed). Here is a cross browser compatible way to do that:

.btn:active{
    -webkit-box-shadow: none;
    box-shadow: none;
    -webkit-transition: none;
    transition: none;
}

Upvotes: 2

Joe
Joe

Reputation: 519

A box shadow is applied during the :active state of the button.

Try this:

.btn:active
{
    box-shadow:none;
}

Upvotes: 13

Related Questions