--- id: bad87fee1348bd9acde08812 title: 画像をモバイルでレスポンシブにする challengeType: 0 forumTopicId: 18232 dashedName: make-images-mobile-responsive --- # --description-- はじめに、既存の画像の下に新しい画像を追加してください。 その `src` 属性を `https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg` に設定してください。 この画像を携帯電話の画面の幅にぴったり合わせることはできるでしょうか。 幸い、Bootstrapでは画像に `img-responsive` クラスを追加するだけで済みます。 このクラスを追加すると、画像はページの幅にぴったり合います。 # --hints-- 画像は全部で2枚必要です。 ```js assert($('img').length === 2); ``` 新しい画像は古い画像の下に表示し、クラス `img-responsive` を付けます。 ```js assert($('img:eq(1)').hasClass('img-responsive')); ``` 新しい画像にはクラス `smaller-image` を付けません。 ```js assert(!$('img:eq(1)').hasClass('smaller-image')); ``` 新しい画像の `src` を `https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg` に設定します。 ```js assert($('img:eq(1)').attr('src') === 'https://cdn.freecodecamp.org/curriculum/cat-photo-app/running-cats.jpg'); ``` 新しい `img` 要素には終了を示す角かっこが必要です。 ```js assert( code.match(//g).length === 2 && code.match(/

CatPhotoApp

Click here for cat photos.

A cute orange cat lying on its back.

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.

Things cats love:

Top 3 things cats hate:

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