--- id: bad87fee1348bd9aeda08845 title: 响应式风格的复选框 challengeType: 0 forumTopicId: 18269 required: - link: >- https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css raw: true dashedName: responsively-style-checkboxes --- # --description-- Bootstrap 的 `col-xs-*` 可应用于所有的 `form` 元素上,包括复选框! 这样就可以不必关注屏幕大小,均匀地把复选框放在页面上了。 # --instructions-- 将所有三个复选框都放置于一个 `
` 元素中。 然后分别把每个复选框都放置于一个 `
` 元素中。 # --hints-- 将所有的复选框嵌入一个含有 `row` class 的 `div` 元素中。 ```js assert($('div.row:has(input[type="checkbox"])').length > 0); ``` 每一个复选框应该嵌套于单独的具有 `col-xs-4` class 的 `div` 元素中。 ```js assert($('div.col-xs-4:has(input[type="checkbox"])').length > 2); ``` 确保所有 `div` 元素都有一个闭合标签。 ```js assert( code.match(/<\/div>/g) && code.match(/
/g).length === code.match(/

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
``` # --solutions-- ```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
```