96 lines
1.5 KiB
Markdown
96 lines
1.5 KiB
Markdown
|
---
|
||
|
id: 60a3e3396c7b40068ad6998e
|
||
|
title: 步驟 36
|
||
|
challengeType: 0
|
||
|
dashedName: step-36
|
||
|
---
|
||
|
|
||
|
# --description--
|
||
|
|
||
|
`.three` 的 `blur` 增加 2 個像素。
|
||
|
|
||
|
# --hints--
|
||
|
|
||
|
應該將 `filter` 屬性設置爲 `blur(2px)`。
|
||
|
|
||
|
```js
|
||
|
const filterFilter = new __helpers.CSSHelp(document).getCSSRules().filter(x => x.style.filter === 'blur(2px)');
|
||
|
assert(filterFilter.length === 2);
|
||
|
```
|
||
|
|
||
|
`.three` 元素的 `filter` 值應爲 `blur(2px)`。
|
||
|
|
||
|
```js
|
||
|
const threeFilter = new __helpers.CSSHelp(document).getStyle('.three')?.getPropertyValue('filter');
|
||
|
assert(threeFilter === 'blur(2px)');
|
||
|
```
|
||
|
|
||
|
# --seed--
|
||
|
|
||
|
## --seed-contents--
|
||
|
|
||
|
```css
|
||
|
.canvas {
|
||
|
width: 500px;
|
||
|
height: 600px;
|
||
|
background-color: #4d0f00;
|
||
|
overflow: hidden;
|
||
|
filter: blur(2px);
|
||
|
}
|
||
|
|
||
|
.frame {
|
||
|
border: 50px solid black;
|
||
|
width: 500px;
|
||
|
padding: 50px;
|
||
|
margin: 20px auto;
|
||
|
}
|
||
|
|
||
|
.one {
|
||
|
width: 425px;
|
||
|
height: 150px;
|
||
|
background-color: #efb762;
|
||
|
margin: 20px auto;
|
||
|
}
|
||
|
|
||
|
.two {
|
||
|
width: 475px;
|
||
|
height: 200px;
|
||
|
background-color: #8f0401;
|
||
|
margin: 0 auto 20px;
|
||
|
}
|
||
|
|
||
|
.one, .two {
|
||
|
filter: blur(1px);
|
||
|
}
|
||
|
|
||
|
.three {
|
||
|
width: 91%;
|
||
|
height: 28%;
|
||
|
background-color: #b20403;
|
||
|
margin: auto;
|
||
|
--fcc-editable-region--
|
||
|
|
||
|
--fcc-editable-region--
|
||
|
}
|
||
|
```
|
||
|
|
||
|
```html
|
||
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<title>Rothko Painting</title>
|
||
|
<link href="./styles.css" rel="stylesheet">
|
||
|
</head>
|
||
|
<body>
|
||
|
<div class="frame">
|
||
|
<div class="canvas">
|
||
|
<div class="one"></div>
|
||
|
<div class="two"></div>
|
||
|
<div class="three"></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|
||
|
```
|