CSS不适用于按钮

时间:2019-08-28 07:35:43

标签: css

我想在页面上的按钮上应用黄色,但是当我调用该类时,它没有应用到该按钮上,并且当我检查站点上的元素时,它没有显示我在我打电话。 html代码:

<a style="margin-right:30px" href="{% url "layer_quarantine" %} class="btn btn-warning pull-right">
        {% if LANGUAGE_CODE == "fr" %} Couches en attente {% else %} Layers in stand-by {% endif %}</a>

这是CSS

.btn-warning {
  color: #fff;
  background-color: #ff8f31;
  border-color: #ff8118;
}
.btn-warning:focus,
.btn-warning.focus {
  color: #fff;
  background-color: #fd7300;
  border-color: #974500;
}
.btn-warning:hover {
  color: #fff;
  background-color: #fd7300;
  border-color: #d96300;
}
.btn-warning:active,
.btn-warning.active,
.open > .dropdown-toggle.btn-warning {
  color: #fff;
  background-color: #fd7300;
  border-color: #d96300;
}

和按钮上的视图: enter image description here

1 个答案:

答案 0 :(得分:5)

正确关闭a href =“” :)

您的代码:

<a style="margin-right:30px" href="{% url "layer_quarantine" %} class="btn btn-warning pull-right">

工作代码:

<a style="margin-right:30px" href="{% url "layer_quarantine" %}" class="btn btn-warning pull-right">
相关问题