dimanche 3 mai 2020

Add a class to header when url path changes in Laravel 6.2

How can I add a class when I navigate to the individual blog pages.

For example when a user comes to the Home page the header color should be gold and when the user navigates to each and every single blogs the header background color should be red.

I have done it this way, where I need to add the url path to the header each and every time when I add a new blog page.

<div id="header" class="headertop " >
<nav></nav>
</div>

Is there a way where i can add the class when the url passes blog/ ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire