<link href="public/styles/menu.css" rel="stylesheet"></link>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<nav class='Menu'>
<div class='wrapper region'>
<div class="topnav" id="myTopnav">
<a href="./" 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="javascript:void(0);" class="icon" onclick="myFunction()">☰</a>
</div>
</div>
</nav>
<script>
function myFunction() {
var x = document.getElementById("myTopnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
</script>
.Menu{
background: var(--background);
}
.Menu .topnav {
background-color: var(--background);
overflow: hidden;
}
.Menu .topnav a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font: 18px/1.5 Oswald, Koulen;
}
.Menu .active {
background-color: #262f7a;
color: white;
}
.Menu .topnav .icon {
display: none;
}
.Menu .dropdown {
float: left;
overflow: hidden;
}
.Menu .dropdown .dropbtn {
font: 18px/1.5 Oswald, Koulen;
border: none;
outline: none;
color: white;
padding: 14px 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: var(--body-font);
}
.Menu .topnav a:hover, .dropdown:hover .dropbtn {
background-color: var(--background-light);
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), .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;
}
}
Epizy: http://khmerweb.epizy.com