<!--views/partials/menu.php-->
<link href="<?php echo $BASE ?>/public/styles/partials/menu.css" rel="stylesheet" />

<nav class='Menu'>
    <div class='wrapper region'>
        <div class="topnav" id="myTopnav">
            <a href="<?php echo $BASE ?>/" class="active">ទំព័រ​ដើម</a>
            <a href="#news">ព័ត៌មាន</a>
            <a href="#contact">ទំនាក់ទំនង</a>

            <div class="dropdown">
                <button class="dropbtn">ជំពូក
                    <i class="fa fa-caret-down"></i>
                </button>
                <div class="dropdown-content">
                    <a href="#">ជំពូក ក</a>
                    <a href="#">ជំពូក ខ</a>
                    <a href="#">ជំពូក គ</a>
                </div>
            </div>

            <a href="#about">អំពី​យើង​ខ្ញុំ</a>
            <a href="<?php echo $BASE ?>/admin">ចូល​ក្នុង</a>
            <a href="javascript:void(0);" class="icon" onclick="mobileMenu()">&#9776;</a>
        </div>
    </div>
</nav>

<script>
function mobileMenu() {
  var x = document.getElementById("myTopnav");
  if (x.className === "topnav") {
    x.className += " responsive";
  } else {
    x.className = "topnav";
  }
}
</script>

 

/* public/styles/partials/menu.css */
.Menu{
    background: var(--background-dark);
}

.Menu .topnav {
    background-color: var(--background-dark);
    overflow: hidden;
}
  
.Menu .topnav a {
    float: left;
    display: block;
    color: #f2f2f2;
    text-align: center;
    padding: 12px 16px;
    text-decoration: none;
    font-size: 17px;
}
  
.Menu .active {
    background-color: #440505;
    color: white;
}
  
.Menu .topnav .icon {
    display: none;
}
  
.Menu .dropdown {
    float: left;
    overflow: hidden;
}
  
.Menu .dropdown .dropbtn {
    font: var(--body-font);
    font-size: 17px;
    border: none;
    outline: none;
    color: white;
    padding: 12px 16px;
    background-color: inherit;
    margin: 0;
}
  
  
.Menu .dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}
  
.Menu .dropdown-content a {
    float: none;
    color: black;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 14px;
}
  
.Menu .topnav a:hover, .Menu .dropdown:hover .dropbtn {
    background-color: #490808;
    color: white;
}
  
 
.Menu .dropdown-content a:hover {
    background-color: #ddd;
    color: black;
}
  
  
.Menu .dropdown:hover .dropdown-content {
    display: block;
}
  
  
@media screen and (max-width: 600px) {
    .Menu .topnav a:not(:first-child), .Menu .dropdown .dropbtn {
        display: none;
    }

    .Menu .topnav a.icon {
        float: right;
        display: block;
    }
}
  
 @media screen and (max-width: 600px) {
    .Menu .topnav.responsive {position: relative;}
    .Menu .topnav.responsive a.icon {
        position: absolute;
        right: 0;
        top: 0;
    }

    .Menu .topnav.responsive a {
        float: none;
        display: block;
        text-align: left;
    }

    .Menu .topnav.responsive .dropdown {float: none;}
    .Menu .topnav.responsive .dropdown-content {position: relative;}
    .Menu .topnav.responsive .dropdown .dropbtn {
        display: block;
        width: 100%;
        text-align: left;
    }
}

 

GitHub: https://github.com/Sokhavuth/multimedia_

Heroku: https://khmerweb-multimedia1.herokuapp.com/