3.8 KiB
3.8 KiB
id, title, challengeType, videoUrl, forumTopicId, localeTitle
id | title | challengeType | videoUrl | forumTopicId | localeTitle |
---|---|---|---|---|---|
587d78a6367417b2b2512add | Create a Graphic Using CSS | 0 | https://scrimba.com/c/cEDWPs6 | 301048 | Создать графику с помощью CSS |
Description
box-shadow
которое задает тень элемента, а также свойство border-radius
которое контролирует округлость углов элемента. Вы создадите круглый прозрачный объект с хрустящей тень, слегка смещенной в сторону - тень на самом деле будет формой луны, которую вы видите. Чтобы создать круглый объект, свойство border-radius
должно быть установлено равным 50%. Вы можете вспомнить более раннюю задачу о том, что свойство box-shadow
принимает значения для offset-x
, offset-y
, blur-radius
, spread-radius
и значение цвета в этом порядке. Значения blur-radius
spread-radius
необязательны.
Instructions
background-color
на прозрачный, затем установите для свойства border-radius
значение 50%, чтобы сделать круглую форму. Наконец, измените свойство box-shadow
чтобы установить offset-x
в 25px, offset-y
до 10px, blur-radius
до 0, spread-radius
до 0 и цвет в синий.
Tests
tests:
- text: The value of the <code>background-color</code> property should be set to <code>transparent</code>.
testString: assert(code.match(/background-color:\s*?transparent;/gi));
- text: The value of the <code>border-radius</code> property should be set to <code>50%</code>.
testString: assert(code.match(/border-radius:\s*?50%;/gi));
- text: The value of the <code>box-shadow</code> property should be set to 25px for <code>offset-x</code>, 10px for <code>offset-y</code>, 0 for <code>blur-radius</code>, 0 for <code>spread-radius</code>, and finally blue for the color.
testString: assert(code.match(/box-shadow:\s*?25px\s+?10px\s+?0(px)?\s+?0(px)?\s+?blue\s*?;/gi));
Challenge Seed
<style>
.center {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100px;
height: 100px;
background-color: blue;
border-radius: 0px;
box-shadow: 25px 10px 10px 10px green;
}
</style>
<div class="center"></div>
Solution
<style>
.center {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100px;
height: 100px;
background-color: transparent;
border-radius: 50%;
box-shadow: 25px 10px 0 0 blue;
}
</style>
<div class="center"></div>