I searched for similar questions but none worked so I'm here requesting your help. What I want is:
When someone visits "about" the li will become active so that css will apply. When he presses on "service" the same as above will happen etc.
Note 1: this menu is called in the main body with require_once("path/to/navmenu.php") and I don't know if it affects anything
Note 2: I know jQuery is the key here but i tried some code in stackoverflow from similar questions and none worked. A JSfiddle is appreciated
HTML CODE:
<nav class="flexy-menu">
<li class="active"><a href="index.php">home</a><div class="menu-space"></div></li>
<li><a href="about-us-style1.php">about</a><div class="menu-space"></div></li>
<li><a href="service-style2.php">service</a><div class="menu-space"></div></li>
</nav>
CSS CODE:
.flexy-menu li:hover > a,
.flexy-menu li.active a {
background: #c68f50;
color: #fff;
}