--- id: bad87fee1348bd9aec908845 title: Line up Form Elements Responsively with Bootstrap required: - link: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css' raw: true challengeType: 0 videoUrl: '' localeTitle: 使用Bootstrap响应表单元素 --- ## Description
现在让我们将您的表单input和提交button放在同一行。我们将做到这一点,我们以前有相同的方式:通过使用div元素带班row ,和其他div使用中它的元素col-xs-*类。将表单的文本input和提交button嵌套在具有类rowdiv 。将表单的文本input嵌套在具有col-xs-7类的div中。将表单的提交button div具有类col-xs-5div 。这是我们目前为Cat Photo App所做的最后一项挑战。我们希望您喜欢学习Font Awesome,Bootstrap和响应式设计!
## Instructions
## Tests
```yml tests: - text: 将表单提交按钮和文本输入嵌套在带有类row的div中。 testString: 'assert($("div.row:has(input[type=\"text\"])").length > 0 && $("div.row:has(button[type=\"submit\"])").length > 0, "Nest your form submission button and text input in a div with class row.");' - text: 将表单文本输入嵌套在具有类col-xs-7的div中。 testString: 'assert($("div.col-xs-7:has(input[type=\"text\"])").length > 0, "Nest your form text input in a div with the class col-xs-7.");' - text: 将表单提交按钮嵌套在具有类col-xs-5的div中。 testString: 'assert($("div.col-xs-5:has(button[type=\"submit\"])").length > 0, "Nest your form submission button in a div with the class col-xs-5.");' - text: 确保每个div元素都有一个结束标记。 testString: 'assert(code.match(/<\/div>/g) && code.match(/
/g).length === code.match(/
div elements has a closing tag.");' ```
## Challenge Seed
```html

CatPhotoApp

A cute orange cat lying on its back.
Three kittens running towards the camera.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
```
## Solution
```js // solution required ```