用html5和css做一个导航拦
时间: 2024-06-03 22:08:13 浏览: 45
<!DOCTYPE html>
<html>
<head>
<title>导航栏</title>
<style type="text/css">
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
nav {
background-color: #333;
color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
height: 60px;
}
nav ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
}
nav ul li {
margin: 0 10px;
}
nav ul li a {
color: #fff;
text-decoration: none;
padding: 10px;
}
nav ul li a:hover {
background-color: #666;
}
</style>
</head>
<body>
<nav>
<h1>Logo</h1>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</body>
</html>
阅读全文