Here’s my code for Product Landing Page assignment:
When I click on “Client Testimonials” or “Our Services”, I am taken to the corresponding sections within the page. It works just fine. The problem is, after being taken to the required section, there is a white space above the section. (Scrolling up will show the issue). The problem is with the following CSS code.
:target {
position: relative;
padding-top:90px;
background-clip: padding-box;
}
In the above code, the “padding-top:90px” is causing the white space issue. However, if I don’t use the “padding-top:90px” code, the navigation won’t work as intended. The nav bar, which is fixed, will cover the initial part of whatever section I am trying to navigate to. Hope I am clear enough.
Is there a solution to this? Any help will be highly appreciated. I have tried doing some research on this online. I found one source where the above mentioned “:target” idea was used. It worked for them just fine but for me, only partly.