一个简单的hrml导航模板
一个简单的 HTML 导航模板示例,它包含基本的导航栏结构,同时使用了 CSS 进行样式美化,让导航栏看起来更美观。另外,还添加了一些 JavaScript 代码,用于在移动端实现导航菜单的展开和收起功能。
PHP
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>网址导航模板</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
header {
background-color: #333;
color: white;
text-align: center;
padding: 20px;
display: flex;
align-items: center;
justify-content: space-between;
}
.logo {
width: 50px;
height: 50px;
background-color: #fff;
border-radius: 50%;
/* 这里可根据实际情况替换为图片 */
/* background-image: url('your-logo.png');
background-size: cover; */
}
.search-container {
display: flex;
background-color: white;
border-radius: 4px;
overflow: hidden;
}
.search-container input[type="text"] {
padding: 10px;
border: none;
outline: none;
}
.search-container button {
padding: 10px 15px;
background-color: #007BFF;
color: white;
border: none;
cursor: pointer;
}
main {
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 20px;
}
.category {
background-color: white;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin: 10px;
padding: 20px;
width: 300px;
}
.category h2 {
margin-top: 0;
}
.category ul {
list-style-type: none;
padding: 0;
}
.category li {
margin-bottom: 10px;
}
.category a {
color: #007BFF;
text-decoration: none;
transition: color 0.3s;
}
.category a:hover {
color: #0056b3;
}
footer {
background-color: #333;
color: white;
text-align: center;
padding: 10px