When I select an option of my sticky top menu (wich has only ancors) the page goes down a bit more than I want

[ad_1]

Hi it’s me again, the page I’m working on: [https://yellowgreen-mule-391571.hostingersite.com/](https://yellowgreen-mule-391571.hostingersite.com/)

So as you can see when you click on something in the top menu the page scrolls down to the correspondent container, the thing is it behaves like the menu isn’t there and the top edge of the container goes all the way up to the browser limit which results in the container having some of its initial content cut off.

I’m using a header model that I’ve previously designed, my header container have scroll effect transparency 0-2%, effects relative to: full page, motion effect: sticky top.

How do I fix thisss pls should I use position fixed instead??

[ad_2]
3 Comments
  1. Yes this is an issue with sticky menus – most theme’s handle it, without you needing to do anything. One way to fix it is by adding a margin-top to any element that can be selected on the nav, eg `div#tratamentos { padding-top: 5em; }`

  2. Add a negative margin-top to the div you’re scrolling to, and a posotive padding-top of the same amount. You may also have to add display: block

  3. If you have a fixed header, just add this css:

    “`
    * {
    scroll-margin-top: 100px; // or your specific height
    }
    “`

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer