Change an Element's Relative Position

Tell us what’s happening:

I’m sure that this is so simple (sadly!) but having progressed this far without a hitch, I’m suddenly stuck with giving the element a position of relative. Any help would be fantastic and appreciated. Cheers

Your code so far


<style>

  h2{
    positon: relative;
    top: 15px;
  }
</style>
<body>
  <h1>On Being Well-Positioned</h1>
  <h2 class="position" style=relative;>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; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/applied-visual-design/change-an-elements-relative-position

Hi,

Your css appears correct.

You do not need to add any class or style attribute to the <h2> element. The h2 selector in the css will find all h2 elements and apply that styling to them.

Many thanks. I have already done that and it still tells me “wrong”? It keeps saying “The h2 element should have a position property set to relative.”

You misspelled position. I did not notice that the first time

Are you kidding me!! I’m so sorry. Thanks so much for pointing out the obvious…which I’d overlooked!

1 Like