gpt4 book ai didi

html - 将元素符号保持在同一条线上

转载 作者:太空宇宙 更新时间:2023-11-03 20:36:48 25 4
gpt4 key购买 nike

我有同一组的单选按钮,但不知道如何强制它们都在同一行上。有没有人有任何 CSS 技巧可以将它们全部放在同一行而不是将最后一个元素符号放到下一行?

enter image description here

<div id="ownership">
<label class='radiolabel'>
<input type="radio" name="ownership" required="yes" value="BOAT MCO" />Manufacturer's Statement of Origin</label>
<label class='radiolabel'>
<input type="radio" name="ownership" value="BOAT FL Title" />Florida Certificate of Title</label>
<label class='radiolabel'>
<input type="radio" name="ownership" value="BOAT OOS Title" />Out-of-state Certificate of Title</label>
<label class='radiolabel'>
<input type="radio" name="ownership" value="TN Required" />I do not have any of these</label>

</div>

#ownership input[type=radio]{
margin:3px;
margin-left:10px;
}

最佳答案

是的。由于它们被视为内联元素,因此您应该能够在父元素上使用 white-space: nowrap;。像这样:

#ownership {
white-space: nowrap;
}

关于html - 将元素符号保持在同一条线上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31990694/

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