我有一个非常基本的表单,但我使用了第三方 css,这似乎给我带来了问题。我在这个 CSS 中找了很长时间,但找不到任何导致这个问题的原因,
Mevr.<input type="radio" name="gender" value="Mevr.">
Dhr.<input type="radio" name="gender" value="Dhr.">
Fam.<input type="radio" name="gender" value="Fam.">
这是我的期望
随着第三方 CSS 的激活,我得到了这个:
我的问题是:我可以使用哪种内联样式让我的单选按钮像第一张图片中那样彼此相邻?
注意: 导致问题的 css here :
最佳答案
因为你没有给出编码。你可以试试这个:
<style>
.some-class {
float: left;
clear: none;
}
label {
float: left;
clear: none;
display: block;
padding: 2px 1em 0 0;
}
input[type=radio],
input.radio {
float: left;
clear: none;
margin: 2px 0 0 2px;
}
</style>
<div class="some-class">
<input type="radio" class="radio" name="x" value="y" id="y" />
<label for="y">Thing 1</label>
<input type="radio" class="radio" name="x" value="z" id="z" />
<label for="z">Thing 2</label>
</div>
关于html - 单选按钮样式未按预期显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37674851/