见上图 - 我左侧有Bootstrap下拉列表,右侧有按钮。它们很好地对齐,但我想将分页移动到它们之间,以便更好地利用空间。现在,分页代码进一步缩小,但如果我在下拉菜单和按钮之间移动它,它会导致您在第二个图像中看到的内容。我怎么能把一切都对齐?
Bootiply:http://www.bootply.com/5Ufnpj317Z
答案 0 :(得分:1)
答案 1 :(得分:1)
我已经重新安排了相当多的代码,总结如下:
/*test.css*/
#dropdownMenu1-div{
display:inline;
}
#dropdownMenu2-div{
display:inline;
}
.pagination{
margin:0;
}

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<html>
<head>
<link rel="stylesheet" href="bootstrap.css">
<link rel="stylesheet" href="test.css">
</head>
<body>
<h2 class="text-center">Browse</h2>
<hr class="no-bottom-pad">
<div class="container">
<div class="row">
<div class="col-xs-3">
<div class="dropdown inline-control" id="dropdownMenu1-div"">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Location:
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu2">
<li><a href="browse.php?">all</a></li>
<li class="divider"></li>
<li><a href="browse.php?&loc=3">London Waterloo</a></li>
<li><a href="browse.php?&loc=2">London Waterloo 3F workshop</a></li>
<li><a href="browse.php?&loc=1">London Waterloo comms room</a></li>
</ul>
</div>
<div class="dropdown inline-control" id="dropdownMenu2-div">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Type:
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu2">
<li><a href="browse.php?">all</a></li>
<li class="divider"></li>
<li><a href="browse.php?&type=1">Laptop</a></li><li><a href="browse.php?&type=2">Chromebook</a></li>
<li class="divider"></li>
<li><a href="browse.php?&vendor=HP">HP</a></li>
<li><a href="browse.php?&vendor=Lenovo">Lenovo</a></li>
<li><a href="browse.php?&vendor=Toshiba">Toshiba</a></li>
<li class="divider"></li>
<li><a href="browse.php?&model=3">HP Brilliance 5000</a></li>
<li><a href="browse.php?&model=1">Lenovo B50-70</a></li>
<li><a href="browse.php?&model=2">Toshiba Portege R930</a></li>
</ul>
</div>
</div>
<div class="col-xs-2" id="page-numbers">
<!-- <p class="no-bottom-pad">136 laptops</p> -->
<ul class="pagination">
<li class="active"><a href="browse.php?&page=1">1</a></li>
<li><a href="browse.php?&page=2">2</a></li>
<li><a href="browse.php?&page=3">3</a></li>
</ul>
</div>
<div class="col-xs-7">
<a href="#" id="add-laptop-btn" class="btn btn-default" onclick="laptop_modal('new')">
Add Laptop
</a>
<input id="add-multiple-input" class="btn btn-default less-right-pad" type="number" min="0" max="50">
<a href="#" id="add-multiple-btn" class="btn btn-default less-right-pad disabled" onclick="addMultiple();">
Add Multiple ->
</a>
<input id="earmark-multiple-input" class="btn btn-default less-right-pad" type="number" min="0" max="50">
<a href="#" id="earmark-multiple-btn" class="btn btn-default less-right-pad disabled" onclick="addMultiple();">
Earmark Multiple ->
</a>
</div>
</div>
</div>
</body>
</html>
&#13;