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