---
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"), "Give the submit button in your form the classes 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, "Add a <i class="fa fa-paper-plane"></i> within your submit button element.");'
- text: 在表单中input文本input类form-control 。
testString: 'assert($("input[type=\"text\"]").hasClass("form-control"), "Give the text input in your form the class form-control.");'
- text: 确保每个i元素都有一个结束标记。
testString: 'assert(code.match(/<\/i>/g) && code.match(/<\/i/g).length > 3, "Make sure each of your i elements has a closing tag.");'
```
## Challenge Seed