I am using an "anchor" class to position links under a fixed header

Hi I am practicing using an anchor class to position my links underneath my fixed header. It works great if I put a bunch of
s at the end of my code. If I take them out, it doesn’t position the links right. Can anyone tell me why?

If I take out all those <br>s it seems to still position the links correctly. Would you describe in a little more detail what is not working when you remove them?

In my browser, the first 2 links position correctly but when I click the “Buy Now” link, it doesn’t bring the content up high enough and the video covers the header. If add the break rules, the “buy now” content goes right up to the bottom of the header, right where I want it. (Thanks for replying)

Two issues here:

  • The “Buy Now” link is working properly without the extra <br>s at the bottom. The reason the content doesn’t go all the way up to the header is because your page isn’t tall enough. Adding the <br>s makes it taller so that the content can scroll higher. But that is not the way you should do it. If you want to artificially increase the length of the page at the bottom then maybe use a <div> and set a height on it with CSS.
  • The video should not be floating above the header at all. You can fix this using CSS. Perhaps look at the z-index property?
1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.