我在网络开发方面不是很有经验,并且遇到了一些问题,形成了一个下拉菜单列表和一个标题。 我明白了:
我正试图得到这样的东西:
这是我写的代码。
@import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
<div class="row" align="center" id="filtros">
<div class="col-md-3">1. Cerca de tí
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Todas las delegaciones
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="#">Action</a>
</li>
</ul>
</div>
</div>
<div class="col-md-3">2. ITS
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Todas las delegaciones
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="#">Action</a>
</li>
</ul>
</div>
非常感谢任何帮助。
答案 0 :(得分:0)
将div设为display:inline-block,这样就可以达到预期的标记
检查此代码段
@import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
.col-md-3 {
display: inline-block;
}
ul {
list-style-type: none;
}
&#13;
<div class="row" align="center" id="filtros">
<div class="col-md-3">1. Cerca de tí
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Todas las delegaciones
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="#">Action</a>
</li>
</ul>
</div>
</div>
<div class="col-md-3">2. ITS
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Todas las delegaciones
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="#">Action</a>
</li>
</ul>
</div>
&#13;
希望这有帮助