Html 引导-css-下拉菜单的中心选项
我用不同的元素制作了一个网页。其中之一是下拉菜单。我把一个元素放在网页中间: 但当我单击下拉菜单的按钮并显示选项时,这些选项并不居中 我的HTML代码:Html 引导-css-下拉菜单的中心选项,html,css,twitter-bootstrap,bootstrap-table,Html,Css,Twitter Bootstrap,Bootstrap Table,我用不同的元素制作了一个网页。其中之一是下拉菜单。我把一个元素放在网页中间: 但当我单击下拉菜单的按钮并显示选项时,这些选项并不居中 我的HTML代码: <div class="container-fluid"> <!-- Solo indicamos container-fluid ya que si añadimos container éste ocupa el 60% del a página --> <div class="row tex
<div class="container-fluid"> <!-- Solo indicamos container-fluid ya que si añadimos container éste ocupa el 60% del a página -->
<div class="row text-center">
<h1>MIQUEL ALIMENTACIÓ</h1>
<h4 id='titEdicion'></h4><h4 id='titEstado'></h4>
</div>
<br>
<div id="toolbar">
<div class="row text-center">
<div class="dropdown">
<button class="btn btn-addcom dropdown-toggle btn-size-edicion" type="button" data-toggle="dropdown">SELECCIONAR EDICIÓ
<span class="caret"></span></button>
<ul class="dropdown-menu text-center" id="drEdicion">
<li"><a href=#>TOT</a></li>
<?php
$result = dbQuery($conn, "SELECT * FROM produccion.ma_edicion");
while ($row = pg_fetch_row($result)){ ?>
<li><a href=#><?php echo $row[2]; ?></a></li>
<?php
}
?>
</ul>
</div>
</div>
<br>
<div class="row text-center">
<div>
<button id="newedition" type="submit" class="btn btn-group btn-size-edicion" data-toggle='modal' data-target='#edicion'>NOVA EDICIÓ</button>
</div>
</div>
</div>
</div>
米克尔食品公司
选择法令
你可以试试
<button class="btn btn-addcom dropdown-toggle btn-size-edicion" id="menu_list" type="button" data-toggle="dropdown">SELECCIONAR EDICIÓ
<span class="caret"></span></button>
<ul class="dropdown-menu text-center" id="drEdicion" aria-labelledby="menu_list">
<li"><a href=#>TOT</a></li>
<?php
$result = dbQuery($conn, "SELECT * FROM produccion.ma_edicion");
while ($row = pg_fetch_row($result)){ ?>
<li><a href=#><?php echo $row[2]; ?></a></li>
<?php
}
?>
</ul>
selecciional EDICIÓ
你可以试试
<button class="btn btn-addcom dropdown-toggle btn-size-edicion" id="menu_list" type="button" data-toggle="dropdown">SELECCIONAR EDICIÓ
<span class="caret"></span></button>
<ul class="dropdown-menu text-center" id="drEdicion" aria-labelledby="menu_list">
<li"><a href=#>TOT</a></li>
<?php
$result = dbQuery($conn, "SELECT * FROM produccion.ma_edicion");
while ($row = pg_fetch_row($result)){ ?>
<li><a href=#><?php echo $row[2]; ?></a></li>
<?php
}
?>
</ul>
selecciional EDICIÓ
只要实际的下拉列表处于绝对位置,您就不能单独将该列表居中。事实上,这就是为什么它不居中:)解决方案之一是用
包装下拉列表,并赋予其风格:
.dropdown-wrapper {
width: 30%;
margin: 0 auto;
}
宽度可以是您想要的任何宽度
。下拉包装器{
宽度:30%;
保证金:0自动;
}
选择法令
只要实际的下拉列表处于绝对位置,您就不能单独将此列表居中。事实上,这就是为什么它不居中:)解决方案之一是用
包装下拉列表,并赋予其风格:
.dropdown-wrapper {
width: 30%;
margin: 0 auto;
}
宽度可以是您想要的任何宽度
。下拉包装器{
宽度:30%;
保证金:0自动;
}
选择法令
你能为我们添加相关CSS代码吗?你能为我们添加相关CSS代码吗?谢谢@Anton Koning它的作品!我已经用结果截图更新了问题。选项元素不在中心下拉列表中:(@ruzD那么它工作吗?当我打开你的小提琴并根据我的答案进行调整时,它工作得非常好。请更新你的小提琴,这样我就可以看到还有什么需要调整了!在小提琴中工作正常,但在我的代码中不工作。我会尝试它…谢谢@Anton Koning它工作了!我已经用结果的屏幕截图更新了问题中尉。选项元素不在中间下拉列表中:(@ruzD)它工作了吗?当我打开你的提琴并根据我的答案进行调整时,它工作得非常好。请更新你的提琴,以便我可以看到还有什么需要调整的地方是正确的!在提琴中可以工作,但在我的代码中不工作。我将尝试它。。。