【发布时间】:2023-03-11 18:50:01
【问题描述】:
我使用引导程序在下拉列表中放置了复选框,但是它们都是居中对齐的。我想左对齐下拉项目。这是代码
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<form class="dropdown-menu" aria-labelledby="dropdownMenuButton2">
<label class="dropdown-item-left"><input type="checkbox" id="f1" name="result[]">AAAAA</label>
<label class="dropdown-item"><input type="checkbox" id="f2" name="result[]">BBBBBBBBBB</label>
<label class="dropdown-item"><input type="checkbox" id="f3" name="result[]">CCCCCCCCCCCCCCCCCCCC</label>
<label class="dropdown-item"><input type="checkbox" id="f4" name="result[]">DDDDDDDDD</label>
<label class="dropdown-item"><input type="checkbox" id="f5" name="result[]">EEEEEEEE</label>
</form>
</div>
看起来是这样的:
我尝试使用单独的 css 文件使用 text-align: left、align-self 等,但它不起作用。
请帮帮我。
提前致谢。
【问题讨论】:
标签: javascript html css django bootstrap-4