M
M
Maxim Tyulpakov2015-11-11 09:56:52
PHP
Maxim Tyulpakov, 2015-11-11 09:56:52

How to fix the menu button of the open page?

When you hover over the menu, everything is OK, it is underlined. But when the page is opened, it is not fixed.
740aae4f5cc94fb9b708c42daf677374.JPG

<!-- навигация -->
    <div class="main-menu">
      <?php require_once'inc/menu.inc.php'; ?>

    </div>

content of the plug-in menu:
<nav>
        <ul>
          <li><a href="index.php?id=home">главная</a></li>
          <li><a href="index.php?id=testing">тестирование</a></li>
          <li><a href="index.php?id=plans">план развития сайта</a></li>
        </ul>
      </nav>

.main-menu li a{
  text-decoration:none;
  text-transform:uppercase;
  color:white;
  font-size:110%;
}
.main-menu li a:hover,.main-menu li a:active, .main-menu li a:focus{
  color:#deeaff;
  padding-bottom:12px;
  border-bottom:5px solid #deeaff;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail, 2015-11-11
Chirskiy @chirskiy_mixail

In php check if you are on this page then add class .active for example

if(url == current_page) {

}

Is the point clear?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question