Error trying to access a section on a page by clicking on a link that is on another page

Viewed 51

I am trying to access a section that is in my index.php page by clicking on a link that is in other pages ... The link is in the navbar-menu, when I clicked on the link, it would take me to a section that is on my index.php page Before, this worked very well but now it does not work well. When I click on my link, it takes me to another section, not to the section that I want.

This is my navbar-code:

       <li class="list_options_Li" id="first_li_main"><a href="leistungen.php" class="smoothScroll main_a">Leistungen</a></li>
            <li class="list_options_Li" id="second_li_main"><a href="referenzen.php" class="smoothScroll main_a">Referenzen</a></li>
            <li class="list_options_Li" id="third_li_main"><a href="https://nivamedia.ch/index.php#agentur" class="smoothScroll main_a">Agentur</a></li>
            <li class="list_options_Li" id="fourth_li_main"><a href="kontakt.php" class="smoothScroll main_a">Kontakt</a></li>

As you can see, this is the link on menu: href= "https://nivamedia.ch/index.php#agentur"

this is the section with id=agentur

enter image description here

And this is the code in of section agentur in index.php:

           <section id="agentur">

          <div class="container">
           <div class="row">
           <div class="col-md-12 col-sm-12 text-center">
                <div class="section-title" id="agentur_section_title">
                   <h2 class="heading" id="agentur_h1_title" style= "padding-top: 0px; font-size: 700 !important;">Nivamedia-Digital<br> Agentur in Aarau</h2>
                     <hr align=left style="width: 280px;">
                       </div>
                   </div>
                 </div>
                </div>
           </section>

When clicking on the link, that should take me to the section with id = agentur in index.php but that does not happen, instead, it takes me to the end of the page. Before that did not happen, the page worked very well, but now I have this error and I do not know where it came from.

Any ideas on how to solve this? I have reviewed my code and I see it very well.

To show you better, You can Go to this link: https://nivamedia.ch/referenzen.php and click on the menu option "Agentur", it should go to index.php#agentur but it doesn't happen.

1 Answers

Works for me (FF 63). Have you tried clearing your cache? Trying a different browser? Trying in incognito mode?

Also, it looks like your markup is broken. This can often lead to anchors not working (because the browser cannot recognise the anchor). E.g. line 1510:

<p <i id="medium_icon_form1" class="icon-envelope medium-icon wow bounceIn" data-wow-delay="0.6s" style= "padding-right: 160px;"></i> E-Mail</p>
Related