gpt4 book ai didi

css - 带有复选框和文本的水平对齐标签

转载 作者:行者123 更新时间:2023-11-28 01:46:39 25 4
gpt4 key购买 nike

我试图对齐复选框,以便复选框彼此对齐。现在文本彼此对齐。我希望它在中间水平放置,但随后复选框在彼此下方笔直对齐。

<ul class="berocket_aapf_widget  " data-scroll_theme="dark" style="display: block;">
<li class="">
<span>
<input id="checkbox_44" class="checkbox_44" type="checkbox" data-term_id="44" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_44" class="berocket_label_widgets"> Blauw</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_47" class="checkbox_47" type="checkbox" data-term_id="47" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_47" class="berocket_label_widgets"> Rood</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_48" class="checkbox_48" type="checkbox" data-term_id="48" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_48" class="berocket_label_widgets"> Roze</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_82" class="checkbox_82" type="checkbox" data-term_id="82" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_82" class="berocket_label_widgets"> Wit</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_83" class="checkbox_83" type="checkbox" data-term_id="83" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_83" class="berocket_label_widgets"> Zwart</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_84" class="checkbox_84" type="checkbox" data-term_id="84" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_84" class="berocket_label_widgets"> Groen</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_86" class="checkbox_86" type="checkbox" data-term_id="86" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_86" class="berocket_label_widgets"> Multicolor</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_10107" class="checkbox_10107" type="checkbox" data-term_id="10107" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_10107" class="berocket_label_widgets"> Taupe</label>
</span>
</li>
<li class="berocket_widget_show_values" style="display: none;">Show value<span class="show_button"></span></li>
</ul>

https://jsfiddle.net/44d9nqne/

这是一个看起来像的例子,复选框没有在彼此下面对齐。

格茨·威廉姆

最佳答案

如果您需要让您的标签居中对齐并且复选框在一条直线上(这将在您的左侧),则方法不同。

检查 fiddle .

我认为从视觉上看这不是显示列表的好方法。您还需要为列表设置固定宽度。

.

.berocket_aapf_widget {
display: block;
width: 150px;
margin: auto;
}
.berocket_aapf_widget span{
display: inline-block;
width: 100%;
}
.berocket_aapf_widget label{
text-align: center;
display: inline-block;
width: 85%;
}
<ul class="berocket_aapf_widget  " data-scroll_theme="dark" style="display: block;">
<li class="">
<span>
<input id="checkbox_44" class="checkbox_44" type="checkbox" data-term_id="44" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_44" class="berocket_label_widgets"> Blauw</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_47" class="checkbox_47" type="checkbox" data-term_id="47" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_47" class="berocket_label_widgets"> Rood</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_48" class="checkbox_48" type="checkbox" data-term_id="48" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_48" class="berocket_label_widgets"> Roze</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_82" class="checkbox_82" type="checkbox" data-term_id="82" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_82" class="berocket_label_widgets"> Wit</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_83" class="checkbox_83" type="checkbox" data-term_id="83" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_83" class="berocket_label_widgets"> Zwart</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_84" class="checkbox_84" type="checkbox" data-term_id="84" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_84" class="berocket_label_widgets"> Groen</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_86" class="checkbox_86" type="checkbox" data-term_id="86" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_86" class="berocket_label_widgets"> Multicolor</label>
</span>
</li>
<li class="">
<span>
<input id="checkbox_10107" class="checkbox_10107" type="checkbox" data-term_id="10107" data-taxonomy="pa_kleur" data-operator="OR"><label for="checkbox_10107" class="berocket_label_widgets"> Taupe</label>
</span>
</li>
<li class="berocket_widget_show_values" style="display: none;">Show value<span class="show_button"></span></li>
</ul>

关于css - 带有复选框和文本的水平对齐标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50156637/

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