我想更改bootstrap分頁顏色,但我不能以任何方式進行,無論我做什麼,它都是藍色。我希望將.pagination li a.active更改爲紅色,將.pagination li a更改爲黑色。我做錯了什麼?無法更改Bootstrap分頁顏色
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" <link rel="stylesheet" href="http://path/to/font-awesome/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
.pagination ul {
display: inline-block;
padding: 0;
margin: 0;
}
.pagination li {
display: inline;
}
.pagination li a {
color: black;
float: left;
padding: 8px 16px;
text-decoration: none;
}
.pagination li a.active {
background-color: red;
color: white;
}
.pagination li a:hover:not(.active) {
background-color: #ddd;
}
</style>
</head>
<body>
<div class="container text-center">
<ul class="pagination">
<li><a href="#">«</a>
</li>
<li><a href="#">1</a>
</li>
<li class="active"><a href="#">2</a>
</li>
<li><a href="#">3</a>
</li>
<li><a href="#">4</a>
</li>
<li><a href="#">5</a>
</li>
<li><a href="#">»</a>
</li>
</ul>
</div> *emphasized text*</div>
</body>
</html>
工作例如,你可以使用!重要的,或者你可以只添加你的外部CSS文件引導css文件後重寫引導CSS – Keith