Back to Freecodecamp

Step 14

curriculum/challenges/english/blocks/learn-intermediate-css-by-building-a-cat-painting/6476fd4213318f6ee211028a.md

latest1.5 KB
Original Source

--description--

Now replace the position property value of your .cat-head with fixed. Leave both top and left as they are.

After that, scroll up and down to see how the fixed value works.

--hints--

Your .cat-head selector should have a position property set to fixed. Make sure you add a semicolon.

js
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.position === 'fixed')

Your .cat-head selector should have a top property set to 100px. Make sure you add a semicolon.

js
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.top === '100px')

Your .cat-head selector should have a left property set to 100px. Make sure you add a semicolon.

js
assert(new __helpers.CSSHelp(document)?.getStyle('.cat-head')?.left === '100px')

--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>
      <div class="box"></div>
    </main>
</body>
</html>
css
* {
  box-sizing: border-box;
}

body {
  background-color: #c9d2fc;
}

.cat-head {
--fcc-editable-region--
  position: relative;
  top: 100px;
  left: 100px;
--fcc-editable-region--
  background: linear-gradient(#5e5e5e 85%, #45454f 100%);
  width: 205px;
  height: 180px;
  border: 1px solid #000;
  border-radius: 46%;
}

.box {
  width: 200px;
  height: 600px;
  background-color: #000;
  position: absolute;
  left: 650px;
  top: 800px;
}