Back to Freecodecamp

Step 34

curriculum/challenges/english/blocks/workshop-cat-painting/646dd6f9caa862627dd87772.md

latest2.3 KB
Original Source

--description--

Move the inner ear into position with a position property set to absolute, a top of 22px, and a left of -20px.

--hints--

Your .cat-left-inner-ear selector should have a position property set to absolute.

js
assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.position, 'absolute')

Your .cat-left-inner-ear selector should have a top property set to 22px.

js
assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.top, '22px')

Your .cat-left-inner-ear selector should have a left property set to -20px.

js
assert.equal(new __helpers.CSSHelp(document).getStyle('.cat-left-inner-ear')?.left, '-20px')

--seed--

--seed-contents--

html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>fCC Cat Painting</title>
    <link rel="stylesheet" href="./styles.css">
</head>
<body>
    <main>
      <div class="cat-head">
        <div class="cat-ears">
          <div class="cat-left-ear">
            <div class="cat-left-inner-ear"></div>
          </div>
          <div class="cat-right-ear">
            <div class="cat-right-inner-ear"></div>
          </div>
        </div>
      </div>
    </main>
</body>
</html>
css
* {
  box-sizing: border-box;
}

body {
  background-color: #c9d2fc;
}

.cat-head {
  position: absolute;
  right: 0;
  left: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  background: linear-gradient(#5e5e5e 85%, #45454f 100%);
  width: 205px;
  height: 180px;
  border: 1px solid #000;
  border-radius: 46%;
}

.cat-left-ear {
  position: absolute;
  top: -26px;
  left: -31px;
  z-index: 1;
  border-top-left-radius: 90px;
  border-top-right-radius: 10px;
  transform: rotate(-45deg);
  border-left: 35px solid transparent;
  border-right: 35px solid transparent;
  border-bottom: 70px solid #5e5e5e;
}

.cat-right-ear {
  position: absolute;
  top: -26px;
  left: 163px;
  z-index: 1;
  transform: rotate(45deg);
  border-top-left-radius: 90px;
  border-top-right-radius: 10px;
  border-left: 35px solid transparent;
  border-right: 35px solid transparent;
  border-bottom: 70px solid #5e5e5e;
}

.cat-left-inner-ear {
  --fcc-editable-region--
  
  --fcc-editable-region--
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-bottom: 40px solid #3b3b4f;
}