You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
932 B

# 行内排列的表单
10 years ago
10 years ago
- order: 1
10 years ago
在**视口宽度大于等于 768px **时,你可以为 `<form>` 标签添加 `.ant-form-inline` 类可使其表现为 inline-block 级别的控件。
---
````jsx
var Checkbox = antd.Checkbox;
React.render(
<form className="ant-form-inline">
<div className="ant-form-item">
<label for="userName">账户:</label>
<input className="ant-input" type="text" id="userName" placeholder="请输入账户名" />
10 years ago
</div>
<div className="ant-form-item">
<label for="password">密码:</label>
<input className="ant-input" type="password" id="password" placeholder="请输入密码" />
10 years ago
</div>
9 years ago
<div className="ant-form-item">
<label className="ant-checkbox-inline">
<Checkbox /> 记住我
</label>
</div>
<input type="submit" className="ant-btn ant-btn-primary" value="登 录" />
</form>
, document.getElementById('components-form-demo-inline-form'));
10 years ago
````