这是我的HTML代码
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>哲科军事社</title>
<!-- AOS 动画库 -->
<link href="https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.css" rel="stylesheet" />
<style>
:root {
--primary-color: #2c3e50;
--accent-color: #c0392b;
--bg-color: #f4f4f4;
--white: #fff;
--tech-blue: #00e0ff;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: "Helvetica Neue", Arial, sans-serif;
background-color: var(--bg-color);
color: #333;
}
header {
background-color: var(--primary-color);
color: var(--white);
text-align: center;
padding: 20px;
}
header p {
margin-top: 5px;
font-size: 16px;
}
.navbar {
background-color: var(--accent-color);
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 20px;
flex-wrap: wrap;
}
.nav-links {
display: flex;
gap: 15px;
}
.nav-links a {
color: var(--white);
text-decoration: none;
background-color: #a32c1e;
padding: 8px 15px;
border-radius: 20px;
transition: background 0.3s, transform 0.2s;
}
.nav-links a:hover {
background-color: #000;
transform: scale(1.05);
}
.menu-toggle {
display: none;
font-size: 24px;
color: var(--white);
cursor: pointer;
}
main {
max-width: 960px;
margin: auto;
padding: 20px;
}
section {
display: none;
text-align: center;
padding: 20px;
}
section.active {
display: block;
}
section h2 {
font-size: 24px;
border-bottom: 2px solid var(--accent-color);
display: inline-block;
margin-bottom: 20px;
}
section p {
font-size: 18px;
margin-bottom: 20px;
}
section img {
max-width: 100%;
border-radius: 12px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
footer {
text-align: center;
padding: 15px;
background-color: var(--primary-color);
color: var(--white);
margin-top: 40px;
}
/* ✅ 活动时间轴样式:科技感设计 */
#timeline {
background-color: #000000;
color: #f0f0f0;
padding: 40px 20px;
border-radius: 12px;
}
.timeline-container {
position: relative;
margin: 20px auto;
padding-left: 20px;
border-left: 3px solid var(--tech-blue);
}
.timeline-item {
position: relative;
margin-bottom: 30px;
padding-left: 20px;
}
.timeline-dot {
position: absolute;
left: -11px;
top: 5px;
width: 16px;
height: 16px;
background-color: var(--tech-blue);
border-radius: 50%;
box-shadow: 0 0 8px var(--tech-blue);
}
.timeline-content h3 {
margin: 0;
font-size: 20px;
color: var(--tech-blue);
}
.timeline-content p {
margin: 5px 0 0;
font-size: 16px;
color: #ccc;
}
@media (max-width: 768px) {
.nav-links {
display: none;
flex-direction: column;
width: 100%;
background-color: var(--accent-color);
margin-top: 10px;
}
.nav-links.show {
display: flex;
}
.menu-toggle {
display: block;
}
}
</style>
</head>
<body>
<header data-aos="fade-down">
<h1>哲科军事社</h1>
<p>传播军事知识 · 探索科学与哲学</p>
</header>
<!-- ✅ 导航栏 -->
<nav class="navbar">
<span class="menu-toggle" onclick="toggleMenu()">☰</span>
<div class="nav-links" id="navLinks">
<a href="#" onclick="showSection('home')">首页</a>
<a href="#" onclick="showSection('team')">团队</a>
<a href="#" onclick="showSection('timeline')">活动时间轴</a>
<a href="#" onclick="showSection('contact')">联系我们</a>
</div>
</nav>
<main>
<!-- ✅ 首页 -->
<section id="home" class="active" data-aos="fade-up">
<h2>欢迎来到哲科军事社</h2>
<p>哲科军事社致力于传播军事知识、探索科学与哲学在军事领域的应用,为广大军事爱好者提供一个交流和学习的平台。</p>
<img src="https://via.placeholder.com/800x400?text=哲科军事社+首页图片" alt="首页图片">
</section>
<!-- ✅ 团队 -->
<section id="team" data-aos="fade-up">
<h2>我们的团队</h2>
<p><strong>1. Allen(艾伦)</strong><br>Allen 是哲科军事社的社长,负责讲课与内容策划。</p>
<img src="https://via.placeholder.com/400x300?text=Allen+照片" alt="Allen照片">
</section>
<!-- ✅ 活动时间轴(科技感设计) -->
<section id="timeline" data-aos="fade-up">
<h2>社区活动时间轴</h2>
<div class="timeline-container">
<div class="timeline-item" data-aos="fade-up">
<div class="timeline-dot"></div>
<div class="timeline-content">
<h3>2024年10月</h3>
<p>这是第一次活动的时间。</p>
</div>
</div>
<div class="timeline-item" data-aos="fade-up">
<div class="timeline-dot"></div>
<div class="timeline-content">
<h3>2025年1月</h3>
<p>这是第二次活动的时间。</p>
</div>
</div>
<div class="timeline-item" data-aos="fade-up">
<div class="timeline-dot"></div>
<div class="timeline-content">
<h3>2025年3月</h3>
<p>这是第三次活动的时间。</p>
</div>
</div>
<div class="timeline-item" data-aos="fade-up">
<div class="timeline-dot"></div>
<div class="timeline-content">
<h3>2025年3月</h3>
<p>这是第四次活动的时间。</p>
</div>
</div>
</div>
</section>
<!-- ✅ 联系我们 -->
<section id="contact" data-aos="fade-up">
<h2>联系我们</h2>
<p>
欢迎通过以下方式与我们联系:<br>
📧 邮箱:<a href="mailto:Allen.he_31@tsinglan.org">Allen.he_31@tsinglan.org</a><br>
💬 微信:Allen_Heshi
</p>
<img src="https://via.placeholder.com/500x300?text=联系我们" alt="联系我们图片">
</section>
</main>
<footer>
© 2025 哲科军事社 · 保留所有权利
</footer>
<!-- AOS 动画库 -->
<script src="https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.js"></script>
<script>
AOS.init();
function showSection(id) {
document.querySelectorAll("section").forEach(sec => {
sec.classList.remove("active");
});
document.getElementById(id).classList.add("active");
const nav = document.getElementById("navLinks");
if (nav.classList.contains("show")) {
nav.classList.remove("show");
}
}
function toggleMenu() {
document.getElementById("navLinks").classList.toggle("show");
}
</script>
</body>
</html>
在我打开“时间活动轴”,我的“社区活动时间轴”和下面的内容不是对齐的