How can I make these menus show under the inscription menu in one line and not one below the other? And the menu should always be visible at the top.
function menux() {
var x = document.getElementById("menu");
if (x.style.display === "none") {
x.style.display = "block";
}
else {
x.style.display = "none";
}
}
nav {
top: 0;
font: 15px verdana;
background-color: #368a9a;
width: 15%;
height: 100%;
position:sticky;
}
ul {
list-style-type: none;
overflow: hidden;
padding: 0;
margin: 0;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
</head>
<body>
<nav>
<h3 onclick="menux()">Menu</h3>
<ul id="menu">
<li><a class="active" href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</nav>
<section>
<div> test</div>
<div> test</div>
<div> test</div>
<div> test</div>
<div> test</div>
<div> test</div>
</section>
</body>
</html>
--EDITED POST- I added a piece of code and I'm counting on someone to help me