---
id: 587d78a5367417b2b2512ad9
title: Use the CSS Transform scale Property to Change the Size of an Element
challengeType: 0
videoUrl: ''
localeTitle: 使用CSS Transform scale属性更改元素的大小
---
## Description
要更改元素的比例,CSS具有transform
属性及其scale()
函数。以下代码示例将页面上所有段落元素的大小加倍: p {
变换:比例(2);
}
## Instructions
使用ball2
的id将元素的大小ball2
原始大小的1.5倍。
## Tests
```yml
tests:
- text: '设置#ball2
的transform
属性,将其缩放为其大小的1.5倍。'
testString: 'assert(code.match(/#ball2\s*?{\s*?left:\s*?65%;\s*?transform:\s*?scale\(1\.5\);\s*?}|#ball2\s*?{\s*?transform:\s*?scale\(1\.5\);\s*?left:\s*?65%;\s*?}/gi), "Set the transform
property for #ball2
to scale it 1.5 times its size.");'
```
## Challenge Seed
## Solution
```js
// solution required
```