如果您能够在没有标签的情况下做到这一点,那么这是我最终使用的 CSS。
CSS
.pagination select {
background-color: #ffffff;
border: 1px solid #dddddd;
color: #337ab7;
float: left;
line-height: 1.42857;
margin-left: -1px;
padding: 6px 12px;
position: relative;
text-align: center;
}
.pagination > li:first-child > select {
border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
margin-left: 0;
}
.pagination > li:last-child > select {
border-bottom-right-radius: 4px;
border-top-right-radius: 4px;
}
.pagination > li > select:hover,
.pagination > li > select:focus {
background-color: #eeeeee;
border-color: #dddddd;
color: #23527c;
}
.pagination-lg > li > select {
font-size: 18px;
padding: 10px 16px;
}
.pagination-lg > li:first-child > select {
border-bottom-left-radius: 6px;
border-top-left-radius: 6px;
}
.pagination-lg > li:last-child > select {
border-bottom-right-radius: 6px;
border-top-right-radius: 6px;
}
.pagination-sm > li > select {
font-size: 12px;
padding: 5px 10px;
}
.pagination-sm > li:first-child > select {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.pagination-sm > li:last-child > select {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
HTML
<div class="container"><nav>
<ul class="pagination">
<li>
<a href="#" aria-label="Previous">
<span aria-hidden="true">«</span>
</a>
</li>
<li><select onchange="if (this.value) window.location.href=this.value">
<option value="?page=1">1</option>
<option value="?page=2">2</option>
<option value="?page=3">3</option>
</select></li>
<li>
<a href="#" aria-label="Next">
<span aria-hidden="true">»</span>
</a>
</li>
</ul>
</nav>
</div>
示例: http: //www.bootply.com/KVb2hwLs57