首页 > 解决方案 > Change background-color of bootstrap's pagination

问题描述

I tried to change the background-color of pagination with !import

static/css/custom_css.css

.pagination>li.active>a {
  background-color: orange !important;
}

The source code:

<nav aria-label="...">
  <ul class="pagination">
    <li class="disabled"><a href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
    <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
    ...
  </ul>
</nav>

I have import it on the top

  <link rel="stylesheet" href="{% static 'simplemde/debug/simplemde.css' %}" />

I tested multiple colors, but it did not correspond

enter image description here

标签: csstwitter-bootstrap

解决方案


它工作正常,但您需要simplemde.css在调用后添加它,bootstrap.css如下所示

.pagination>li.active>a {
  background-color: orange !important;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
 <link rel="stylesheet" href="{% static 'simplemde/debug/simplemde.css' %}" />
 
<nav aria-label="...">
  <ul class="pagination">
    <li class="disabled"><a href="#" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
    <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
    ...
  </ul>
</nav>


推荐阅读