gpt4 book ai didi

html - 输入组插件的对齐

转载 作者:太空宇宙 更新时间:2023-11-04 08:03:08 24 4
gpt4 key购买 nike

我想将输入组插件 (DisplayPaid) 向左移动,以便它与固定宽度输入的右侧对齐。目前它拉到屏幕的右侧。

  <div class="input-group">
<span class="input-group-addon"><span class="glyphicon glyphicon-filter"></span></span>
<select id="ddlCategory" asp-for="SelectedCompanyID" asp-items="Model.Companies" class="form-control"></select>
<span class="input-group-addon"><input id="chkDisplayPaid" type="checkbox" asp-for="DisplayPaid"/> Display Paid</span>
</div>

http://jsfiddle.net/6h0L9t97/

最佳答案

可以使用CSS Flexbox来实现,再添加如下CSS:

.input-group {
display: flex;
}

.input-group-addon {
flex-basis: 40px;
display: flex;
align-items: center; /* Aligning items vertically center */
justify-content: center; /* Aligning items horizontally center */
}

/* You can use a new class name as well */
.input-group-addon:last-child {
flex-basis: 120px;
display: flex;
align-items: center; /* Aligning items vertically center */
justify-content: center; /* Aligning items horizontally center */
}

查看更新后的 Fiddle .

希望这对您有所帮助!

关于html - 输入组插件的对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46860881/

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