--- id: bad87fee1348bd9bedf08813 title: 要素の周りに境界線を追加する challengeType: 0 videoUrl: 'https://scrimba.com/c/c2MvnHZ' forumTopicId: 16630 dashedName: add-borders-around-your-elements --- # --description-- CSSの border には `style`、`color` および `width` のようなプロパティがあります。 例えば、ある HTML 要素の周りに赤色の5ピクセルの境界線を作成したい場合、次のようなクラスを使えます: ```html ``` # --instructions-- `thick-green-border` というクラスを作成しましょう。 このクラスは HTML 要素の周りに 10px、実線 (solid)、緑色の境界線を追加するようにしてください。 猫の写真にこのクラスを適用してください。 1 つの要素に複数のクラスを適用するには、`class` 属性に各クラス名を半角スペースで区切って指定することを覚えておいてください。 例えば次のようになります: ```html ``` # --hints-- `img` 要素にはクラス `smaller-image` が必要です。 ```js assert($('img').hasClass('smaller-image')); ``` `img` 要素にはクラス `thick-green-border` が必要です。 ```js assert($('img').hasClass('thick-green-border')); ``` 画像の境界線の幅は `10px` である必要があります。 ```js assert( $('img').hasClass('thick-green-border') && parseInt($('img').css('border-top-width'), 10) >= 8 && parseInt($('img').css('border-top-width'), 10) <= 12 ); ``` 画像の境界線のスタイルは `solid` である必要があります。 ```js assert($('img').css('border-right-style') === 'solid'); ``` `img` 要素の周りの境界線は緑色でなければなりません。 ```js assert($('img').css('border-left-color') === 'rgb(0, 128, 0)'); ``` # --seed-- ## --seed-contents-- ```html

CatPhotoApp

Click here to view more 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 to view more 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


```