我有一个HTML表单元素:
<form action="doit" id="doit" method="post">
Name <br/>
<input id="name" name="name" type="text" /> <br/>
Phone number <br/>
<input id="phone" name="phone" type="text" /> <br/>
Year <br/>
<input id="year" name="year" type="text" /> <br/>
</form>
Run Code Online (Sandbox Code Playgroud)
我希望在字段之间有更多的空间,例如,在行之间
<input id="name" name="name" type="text" /> <br/>而且
Phone number <br/>,
以及之间
<input id="phone" name="phone" type="text" /> <br/>和Year <br/>.
我该怎么做?
Ste*_*ins 12
我会把你的行包装在标签中
<form action="doit" id="doit" method="post">
<label>
Name
<input id="name" name="name" type="text" />
</label>
<label>
Phone number
<input id="phone" name="phone" type="text" />
</label>
<label>
Year
<input id="year" name="year" type="text" />
</label>
</form>
Run Code Online (Sandbox Code Playgroud)
并使用
label, input {
display: block;
}
label {
margin-bottom: 20px;
}
Run Code Online (Sandbox Code Playgroud)
不要使用brs作为间距!
| 归档时间: |
|
| 查看次数: |
101292 次 |
| 最近记录: |