<!--views/menu.php-->
<link href='public/styles/menu.css' rel='stylesheet' />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<section class='Menu'>
    <nav class='wrapper'>
        <div class="topnav" id="myTopnav">
            <a href="#home" 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="./admin">ចូល​ក្នុង</a>
            <a href="javascript:void(0);" class="icon" onclick="mobileMenu()">&#9776;</a>
        </div>
    </nav>
</section>

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

 

/*public/styles/menu.css*/

.Menu .topnav {
    background-color: #175961;
    overflow: hidden;
}
  
.Menu .topnav a {
    float: left;
    display: block;
    color: #f2f2f2;
    text-align: center;
    padding: 15px 16px;
    text-decoration: none;
    font-size: 14px;
}
  
.Menu .active {
    background-color: #04AA6D;
    color: white;
}
  
.Menu .topnav .icon {
    display: none;
}
  
.Menu .dropdown {
    float: left;
    overflow: hidden;
}
   
.Menu .dropdown .dropbtn {
    font-size: 14px;
    border: none;
    outline: none;
    color: white;
    padding: 13px 16px;
    background-color: inherit;
    font-family: 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: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}
  
.Menu .topnav a:hover, .dropdown:hover .dropbtn {
    background-color: var(--background-light);
    color: black;
}
  
.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/gazetta

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