I have a navbar with links to a article with id="about"
, but my navbar is fixed-top, so when I click on the link, my navbar is in front of the title of the section.
I solved this problem by using this: <span id="about" class="anchor"></span>
.main-content article .anchor{
position: absolute;
top: -106px;
}
But for scrollspy I need the href of the link to be the same as the id of the section where I want to "scrollspy" but I can't use the same id twice.
How can I solve this? Is there a way to go to add -100px
to your href or something like that?