--- id: bad87fee1348cd8acef08812 title: ブロック要素の Bootstrap ボタンを作成する challengeType: 0 forumTopicId: 16810 dashedName: create-a-block-element-bootstrap-button --- # --description-- 通常、`btn` および `btn-default` クラスを持つ `button` 要素の幅は、それらが含まれているテキストと同じ幅にしかなりません。 例: ```html ``` このボタンは単語 `Submit` と同じ幅になります。 クラス `btn-block` を追加してブロック要素にすることで、ボタンがページの水平方向のスペース全体を埋めるように広がり、その後に続く要素はすべてブロックの下の「新しい行」に表示されます。 ```html ``` このボタンは利用可能な幅全体に広がって表示されます。 これらのボタンにも `btn` クラスが必要であることに注意してください。 Bootstrap の `btn-block` クラスを Bootstrap ボタンに追加してください。 # --hints-- ボタンには `btn` クラスと `btn-default` クラスを持たせる必要もあります。 ```js assert($('button').hasClass('btn') && $('button').hasClass('btn-default')); ``` ボタンにクラス `btn-block` を持たせます。 ```js assert($('button').hasClass('btn-block')); ``` `button` 要素にはすべて終了タグが必要です。 ```js assert( code.match(/<\/button>/g) && code.match(/

Things cats love:

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
``` # --solutions-- ```html

CatPhotoApp

Click here for cat photos.

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

Things cats love:

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
```