--- id: bad87fee1348bd9acdf08812 title: Size Your Images challengeType: 0 videoUrl: '' localeTitle: 调整图像大小 --- ## Description
CSS有一个名为width的属性,用于控制元素的宽度。就像字体一样,我们将使用px (像素)来指定图像的宽度。例如,如果我们想要创建一个名为larger-image的CSS类,它给HTML元素的宽度为500像素,我们将使用:
<风格>
.larger-image {
宽度:500px;
}
</样式>
## Instructions
创建一个名为smaller-image的类,并使用它来调整图像大小,使其只有100像素宽。 注意
由于浏览器实现的差异,您可能需要100%缩放才能通过此挑战的测试。
## Tests
```yml tests: - text: 您的img元素应该具有smaller-image类。 testString: 'assert($("img[src="https://bit.ly/fcc-relaxing-cat"]").attr("class") === "smaller-image", "Your img element should have the class smaller-image.");' - text: 您的图片应为100像素宽。浏览器缩放应为100%。 testString: 'assert($("img").width() === 100, "Your image should be 100 pixels wide. Browser zoom should be at 100%.");' ```
## Challenge Seed
```html

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats


```
## Solution
```js // solution required ```