Sorrow
Sorrow2y ago

✅ – Sorrow – 05-12 Jan 29

Hi, I'm trying to program a navbar that scrolls with the user. This component has buttons that onclick scrolls to a specific section of the webpage. I accomplished this effect by giving by navbar a sticky position property, but how I find that when use the navbar to scroll to a specific part of the website, the scroll isn't perfect, where the navbar covers content. (This is the effect: https://medium.com/how-to-react/scroll-to-an-element-on-click-in-react-js-8424e478bb9) How do I make it so that the navbar scrolls to the correct location where I want it to scroll?
Medium
Solution:
Nvm seems like I need to set a padding-top property to fix this!
Jump to solution
2 Replies
Solution
Sorrow
Sorrow2y ago
Nvm seems like I need to set a padding-top property to fix this!
reactibot
reactibot2y ago
This question has an answer! Thank you for helping 😄 If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/902647189120118794/1069122834711977994 This thread hasn’t had any activity in 12 hours, so it’s now locked. Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/902647189120118794/1069122834711977994