HTML & CSS Navigation Menu: Simple and Responsive Design
<!DOCTYPE html>
<html>
<head>
<title>Navigation Menu</title>
<style>
/* Resetting default margin and padding of the page */
* {
margin: 0;
padding: 0;
}
<pre><code> /* Styling navigation menu */
nav {
background-color: #333;
padding: 10px;
}
nav ul {
list-style: none;
display: flex;
justify-content: center;
}
nav ul li {
margin-right: 20px;
}
nav ul li a {
color: #fff;
text-decoration: none;
font-size: 20px;
padding: 10px;
border-radius: 5px;
transition: all 0.3s ease;
}
nav ul li a:hover {
background-color: #fff;
color: #333;
}
</style>
</code></pre>
</head>
<body>
<nav>
<ul>
<li><a href='#'>Home</a></li>
<li><a href='#'>About Us</a></li>
<li><a href='#'>Services</a></li>
<li><a href='#'>Portfolio</a></li>
<li><a href='#'>Contact Us</a></li>
</ul>
</nav>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/l4Aj 著作权归作者所有。请勿转载和采集!