There is a site without cms on pure html. Consists of the main blocks like head, sidebar, content and footer. There is a menu in the sidebar. If through the code editor put chrome on the class: active, the link is highlighted. The question is how and what (js or php or ...) select the menu item that the user is in now? And if the user goes two or three levels deep into the site, but the section of the site is the same, then how to be?
Here are the styles and menus (I honestly admit that they were taken from a githab and a little sawed):
#sidebar-button { color: #666 !important; line-height: 3em; text-align: center; display: inline-block; vertical-align: middle; -webkit-transform: translateZ(0); transform: translateZ(0); box-shadow: 0 0 1px rgba(0, 0, 0, 0); -webkit-backface-visibility: hidden; backface-visibility: hidden; -moz-osx-font-smoothing: grayscale; position: relative; overflow: hidden; margin-left: 10%; width: 81%; margin-bottom: 3%; border: 1px solid #8c8c8c; border-radius: 10px 10px 10px 10px; } #sidebar-button:before { content: ""; position: absolute; z-index: -1; left: 50%; right: 50%; bottom: 0; background: #2098d1; height: 4px; -webkit-transition-property: left, right; transition-property: left, right; -webkit-transition-duration: 0.3s; transition-duration: 0.3s; -webkit-transition-timing-function: ease-out; transition-timing-function: ease-out; } #sidebar-button:hover:before, #sidebar-button:focus:before, #sidebar-button:active:before { left: 0; right: 0; } <div id="sidebar"> <ul style="width: 100%;padding-left: 0px; list-style: none;"> <li><a id="sidebar-button" href="/1/page.html">Пункт 1</a> </li> <li><a id="sidebar-button" href="/2/page1.html">Пункт 2</a> </li> <li><a id="sidebar-button" href="/3/page2.html">Пункт 3</a> </li> <li><a id="sidebar-button" href="/4/page3.html">Пункт 4</a> </li> <li><a id="sidebar-button" href="/5/page4.html">Пункт 5</a> </li> </ul> </div>