freeCodeCamp/curriculum/challenges/chinese-traditional/14-responsive-web-design-22/learn-the-css-box-model-by-.../60a3e3396c7b40068ad6998e.md

1.5 KiB

id title challengeType dashedName
60a3e3396c7b40068ad6998e 步驟 36 0 step-36

--description--

.threeblur 增加 2 個像素。

--hints--

應該將 filter 屬性設置爲 blur(2px)

const filterFilter = new __helpers.CSSHelp(document).getCSSRules().filter(x => x.style.filter === 'blur(2px)');
assert(filterFilter.length === 2);

.three 元素的 filter 值應爲 blur(2px)

const threeFilter = new __helpers.CSSHelp(document).getStyle('.three')?.getPropertyValue('filter');
assert(threeFilter === 'blur(2px)');

--seed--

--seed-contents--

.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--
}
<!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>