我正在做来自FreeCodeCamp的调查表单项目。我正在用列表做这件事,但我不能把单选按钮放在另一张桌子下面。这是我的代码:
td {
width: 50%;
text-align: right;
}
label {
margin-right: 15px;
display: inline-block;
float: right;
padding-left: 10%;
text-align: right;
}
.form-control {
width: 50%;
}
<table>
<tr>
<td><label>How likely is that you would recommend freeCodeCamp to a friend?</label></td>
<td class="radios">
<label><input class="form-control" type="radio" name="recomend" value="Definitely">Definitely</label>
<label><input class="form-control" type="radio" name="recomend" value="Definitely">Maybe</label>
<label><input class="form-control" type="radio" name="recomend" value="Definitely">Not Sure</label>
</td>
</tr>
</table>
我得到了这样的东西
而不是这个
发布于 2018-08-07 10:24:14
这应该通过对CSS的以下更改来解决:
label {
margin-right: 15px;
display: block; /* update display to block */
float: unset; /* update this to unset */
padding-left: 10%;
text-align: right;
}
https://stackoverflow.com/questions/-100001970
复制相似问题