且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为每个标签在表单中为CSS添加新行

更新时间:2023-12-04 13:44:40

#answers input {display: block;}

这将使每个输入都在自己的行中。
如果您希望将每个输入的标签放在一行中,您应该做一些类似于

this will make every input in its own line. If you wish to have every input with its label together in a line you should do something like

<form id="answers">
    <label>blue <input id="0" type="radio"></label>
    <label>red <input id="1" type="radio"></label>
    <label>pink <input id="2" type="radio"></label>
    <input type="submit">
</form>

css:
#answers label {display:block;}

css: #answers label {display: block;}

http://jsfiddle.net/barakedry/y6p54vzg/