Move a Relatively Positioned Element with CSS Offsets help

Tell us what’s happening:

Your code so far


<head>
<style>
  h2 {
    position: relative;
    
    
  }
</style>
</head>
<body>
  <h1>On Being Well-Positioned</h1>
  <h2>Move me!</h2>
  <p>I still think the h2 is where it normally sits.</p>
</body>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.103 YaBrowser/18.7.0.2695 Yowser/2.5 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/applied-visual-design/move-a-relatively-positioned-element-with-css-offsets

There are four properties for relative position. They are top, right, bottom and left.

You have to use two of these properties with the value specified in the instruction.

In other words, move it 10px away from the bottom of where it normally sits. // Asks to use bottom property

Similarly,

In other words, move it 15px away from the left of where it normally sits.

<head>
<style>
  h2 {
    position: relative;
    bottom:10px;
    left:15px;
    
  }
</style>
</head>
<body>
  <h1>On Being Well-Positioned</h1>
  <h2>Move me!</h2>
  <p>I still think the h2 is where it normally sits.</p>
</body>

check this

2 Likes

thank you for screen shooting your code, because I’ve been stuck on this lesson for 2days and right before I gave up, I stumbled upon your answer. :sunglasses: