Laravel 5.5 link with Ancora

0

I have the route below that redirects to the main page of my site ..

Route::group(['prefix' =>'site', 'namespace' => 'site'], function(){
    Route::get('/', 'SiteController@index')->name('site');

I wanted to add an anchor to the div services on my site thus:

localhost:8000/site#servicos 

How do I do this in Laravel?

I've tried:

 <a href='{{ route('site') }}#servicos'>Serviços</a>

 <a href='#servicos'>Serviços</a>

 <a href={{ route('site#servicos') }}'>Serviços</a>

 <a href={{ url('site#servicos') }}>'Serviços</a>

 <a href=/site#servicos>'Serviços</a>

They all change the URL but do not redirect to the div I need, suggestions?

    
asked by anonymous 23.02.2018 / 18:06

1 answer

1

An anchor with # will follow an element that has the ID attribute with the same value, see:

<a href="#service">Serviços</a>


<div id="service"></div>
    
23.02.2018 / 19:29