--- id: bad87fee1348bd9bedf08813 title: Add Borders Around Your Elements challengeType: 0 videoUrl: 'https://scrimba.com/c/c2MvnHZ' forumTopicId: 16630 localeTitle: 在元素周围添加边框 --- ## Description
CSS 边框具有stylecolorwidth属性。 假如我们想要创建一个 5px 的红色实线边框包围一个 HTML 元素,我们可以这样做: ```html ```
## Instructions
创建一个thick-green-border CSS class,该 class 应在 HTML 元素周围添加一个 10px 的绿色实线边框,将它应用在猫咪照片上。 记得在一个元素上可以同时应用多个class,通过使用空格来分隔。例子如下: <img class="class1 class2">
## Tests
```yml tests: - text: 'img元素应该含有smaller-image class。' testString: assert($("img").hasClass("smaller-image")); - text: 'img元素应该含有thick-green-border class。' testString: assert($("img").hasClass("thick-green-border")); - text: '设置图片边框为10px。' testString: assert($("img").hasClass("thick-green-border") && parseInt($("img").css("border-top-width"), 10) >= 8 && parseInt($("img").css("border-top-width"), 10) <= 12); - text: '设置图片边框为solid实线。' testString: assert($("img").css("border-right-style") === "solid"); - text: 'img元素的边框颜色应该为绿色。' testString: assert($("img").css("border-left-color") === "rgb(0, 128, 0)"); ```
## Challenge Seed
```html

CatPhotoApp

点击查看更多猫图

一只仰卧着的萌猫

猫咪最喜欢的三件东西:

  • 猫薄荷
  • 激光笔
  • 千层饼

猫咪最讨厌的三件东西:

  1. 跳蚤
  2. 打雷
  3. 同类


```
## Solution
```html // solution required ```