---
id: bad87fee1348bd9aed908845
title: Style Text Inputs as Form Controls
required:
- link: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css'
raw: true
challengeType: 0
videoUrl: ''
localeTitle: 样式文本输入作为表单控件
---
## Description
您可以通过在提交button
元素中添加<i class="fa fa-paper-plane"></i>
来添加fa-paper-plane
Font Awesome图标。为表单的文本输入字段提供一组form-control
。给你的表单提交按钮btn btn-primary
。同时为此按钮提供fa-paper-plane
的Font Awesome图标。具有类.form-control
所有文本<input>
, <textarea>
和<select>
元素的宽度均为100%。
## Instructions
## Tests
```yml
tests:
- text: 在表单中提交btn btn-primary
类的提交按钮。
testString: assert($("button[type=\"submit\"]").hasClass("btn btn-primary"));
- text: 在提交button
元素中添加<i class="fa fa-paper-plane"></i>
。
testString: assert($("button[type=\"submit\"]:has(i.fa.fa-paper-plane)").length > 0);
- text: 在表单中input
文本input
类form-control
。
testString: assert($("input[type=\"text\"]").hasClass("form-control"));
- text: 确保每个i
元素都有一个结束标记。
testString: assert(code.match(/<\/i>/g) && code.match(/<\/i/g).length > 3);
```
## Challenge Seed
```html
Things cats love:
- cat nip
- laser pointers
- lasagna
Top 3 things cats hate:
- flea treatment
- thunder
- other cats
```
## Solution
```js
// solution required
```