--- id: 587d78a6367417b2b2512add title: Create a Graphic Using CSS challengeType: 0 videoUrl: '' localeTitle: 使用CSS创建图形 --- ## Description
通过操纵不同的选择器和属性,您可以制作有趣的形状。其中一个更容易尝试的是月牙形状。对于此挑战,您需要使用设置元素box-shadowbox-shadow属性,以及控制元素角落圆度的border-radius属性。您将创建一个圆形透明对象,其阴影略微偏向侧面 - 阴影实际上将是您看到的月亮形状。要创建圆形对象, border-radius属性应设置为50%的值。您可以从之前的挑战中回想一下, box-shadow属性采用offset-xoffset-yblur-radiusspread-radius和颜色值的值。 blur-radiusspread-radius值是可选的。
## Instructions
在编辑器中操纵方形元素以创建月亮形状。首先,将background-color更改为透明,然后将border-radius属性设置为50%以生成圆形。最后,更改box-shadow属性,将offset-x设置为25px, offset-y为10px, blur-radius为0, spread-radius为0,颜色设置为蓝色。
## Tests
```yml tests: - text: background-color属性的值应设置为transparent 。 testString: 'assert(code.match(/background-color:\s*?transparent;/gi), "The value of the background-color property should be set to transparent.");' - text: border-radius属性的值应设置为50% 。 testString: 'assert(code.match(/border-radius:\s*?50%;/gi), "The value of the border-radius property should be set to 50%.");' - text: box-shadow属性的值应设置为offset-x为25px, offset-y为10px, blur-radius为0, spread-radius为0,最后为颜色为蓝色。 testString: 'assert(code.match(/box-shadow:\s*?25px\s+?10px\s+?0(px)?\s+?0(px)?\s+?blue\s*?;/gi), "The value of the box-shadow property should be set to 25px for offset-x, 10px for offset-y, 0 for blur-radius, 0 for spread-radius, and finally blue for the color.");' ```
## Challenge Seed
```html
```
## Solution
```js // solution required ```