Skip to content

Instantly share code, notes, and snippets.

@gallirohik
Created February 26, 2018 10:18
Show Gist options
  • Save gallirohik/408785fd27e078c2386e8ee76ad18349 to your computer and use it in GitHub Desktop.
Save gallirohik/408785fd27e078c2386e8ee76ad18349 to your computer and use it in GitHub Desktop.
navigation bar
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #111;
}
#homeCat{
display:none;
}
</style>
<script>
function openHome()
{
document.getElementById("homeCat").style.display="block";
}
function closeHome()
{
document.getElementById("homeCat").style.display="none";
}
</script>
</head>
<body>
<ul>
<li><a class="active" href="#home">Home</a></li>
<li><a href="#news" onmouseover="openHome()" onmouseout="closeHome()">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
<div id="homeCat">
hiiii
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment