如何更改按钮CSS单击/拖动颜色?

时间:2016-04-09 13:20:24

标签: javascript html css wordpress button

您可以在此处查看我的网站:https://www.counterboosting.com/buy-csgo-rank-boosting/

拖动"立即购买"按钮,它将随机变为绿色。如果有人能帮助我保持原样橙色。谢谢!



.col-boosting .btn-pay-rank {
	height: 65px;
	font-weight: bold;
	background: #e06b38;
	border: none;
	box-shadow: 0 7px 0 0 #c7511f;
}

.col-boosting .btn-pay-rank:hover {
	height: 65px;
	background: #dd5a22;
	font-weight: bold;
	border: none;
	box-shadow: 0 7px 0 0 #c7511f;
}

.col-boosting .btn-pay-rank[disabled] {
	height: 65px;
	font-weight: bold;
	background: #e06b38;
	border: none;
	box-shadow: 0 7px 0 0 #c7511f;
}

.col-boosting .btn-default {
	height: 65px;
	font-weight: bold;
	background: #e06b38;
	border: none;
	box-shadow: 0 7px 0 0 #c7511f;
}

.col-boosting .btn {
	height: 65px;
	font-weight: bold;
	background: #e06b38;
	border: none;
	box-shadow: 0 7px 0 0 #c7511f;
}

.col-boosting .btn-primary {
	height: 65px;
	font-weight: bold;
	background: #e06b38;
	border: none;
	box-shadow: 0 7px 0 0 #c7511f;
}

.col-boosting .btn-pay-rank-primary:hover, .col-boosting .btn-pay-rank-primary:focus, .col-boosting .btn-pay-rank-primary:active, .col-boosting .btn-pay-rank-primary.active, .open > .dropdown-toggle.btn-pay-rank-primary {
	height: 65px;
	font-weight: bold;
	background: #e06b38;
	border: none;
	box-shadow: 0 7px 0 0 #c7511f;
}

.col-boosting .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary {
	height: 65px;
	font-weight: bold;
	background: #e06b38;
	border: none;
	box-shadow: 0 7px 0 0 #c7511f;
}

.col-boosting .btn-primary:active, .col-boosting .btn-primary.active {
	height: 65px;
	font-weight: bold;
	background: #e06b38;
	border: none;
	box-shadow: 0 7px 0 0 #c7511f;
}




正如您所看到的,我几乎尝试过所有内容,而我似乎无法找到解决方案。一些帮助将不胜感激。谢谢!

1 个答案:

答案 0 :(得分:0)

您有规则需要覆盖

.btn-success:hover,
.btn-success:focus,
.btn-success.focus,
.btn-success:active,
.btn-success.active,
.open>.dropdown-toggle.btn-success {
  color: #fff;
   background-color: #449d44;
   border-color: #398439;
}

此规则会使您的按钮在激活/聚焦时变为绿色。因此,您需要或覆盖它或将其包含在按钮的样式,焦点和活动状态的样式中。

您可以尝试这样的事情:

.col-boosting .btn-pay-rank:hover,
.col-boosting .btn-pay-rank:focus,
.col-boosting .btn-pay-rank:active {
   height: 65px;
   background: #dd5a22;
   font-weight: bold;
   border: 0;
   box-shadow: 0 7px 0 0 #c7511f;
}

这应该有用。

HTH。