How to go to a section from another page

0
          <div class="collapse navbar-collapse" id="navbarNav">
              <div class="mr-auto"></div>
            <ul class="navbar-nav">
              <li class="nav-item active">
                <a class="nav-link smooth-link" href="#hero">Home</a>
              </li>
              <li class="nav-item">
                <a class="nav-link smooth-link" href="#features">Fechas</a>
              </li>
              <li class="nav-item">
                <a class="nav-link smooth-link" href="#blog">Noticias</a>
              </li>
              <li class="nav-item">
                <a class="nav-link smooth-link" href="#project">Música</a>
              </li>
            </ul>
            <form class="form-inline">
                <a href="#contact" class="btn smooth-link align-middle btn-primary">Contacto</a>
            </form>
          </div>
      </div>
    </nav>'

Good I am developing a web page with a template of boostrap 4 and laravel in my index I have different section with a nav which when selecting the focus is on where are those section, my question is how can I do if I am in another html page and go directly to section contact for example which is in the index, I do not know if it is understood

    
asked by Felipe Larraguibel 30.04.2018 в 01:33
source

3 answers

0

1.- Establish an id in the contact section (I think you already have it for what I can understand).

2.- In the link of the menu you must add the id with the "#" at the end. That way you can navigate in the DOM to the id within the established link.

Greetings!

    
answered by 30.04.2018 в 01:46
0

What the Laravel documentation refers to you can do it in different ways

  

Route see link

you have to define the path of the page and the parameter for the section the solution may vary in case you use a progressive JavaScript framework. as VueJS or similar. in this case you can access from your browser using the path http://localhost/#miseccion to have an idea.

In any case let us see your code so that we all have a clearer idea in this

    
answered by 30.04.2018 в 01:56
-1

Thanks to those who responded, I have solved it this way:

href="{{route('inicio')}}#videos">Videos</a>
    
answered by 06.05.2018 в 04:20