gpt4 book ai didi

html - 在 div 中将 DropDownList 居中

转载 作者:太空宇宙 更新时间:2023-11-04 00:47:57 25 4
gpt4 key购买 nike

我想将 DropDownList 置于 div 的中心吗?

这是我的代码:

<div id="divRech" class="icon-select-group form-control"> 
<asp:DropDownList ID="ddlHotelIslands" runat="server" AutoPostBack="false" name="search-hotel-island">
</asp:DropDownList>
</div>

最佳答案

默认情况下,select 标签不在 display: block 上,您可以像这样将它放在父 div 的中间:

div#divRech { width: 80%; margin: auto; border: 1px solid black; }
div#divRech #ddlHotelIslands { display: block; margin: auto; }
<div id="divRech" class="icon-select-group form-control"> 
<select ID="ddlHotelIslands" runat="server" AutoPostBack="false" name="search-hotel-island">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</div>

关于html - 在 div 中将 DropDownList 居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56662200/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com