一个响应式的个人简历网页。这个页面将展示个人信息、工作经验、教育背景和技能,同时也会使用现代的CSS技术来增强视觉效果。
HTML结构 (resume.html
)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>个人简历</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header class="resume-header">
<h1>张三</h1>
<p>前端开发者</p>
<div class="contact-info">
<a href="mailto:zhangsan@example.com">zhangsan@example.com</a>
<span>|</span>
<a href="tel:+1234567890">+1234567890</a>
</div>
</header>
<section class="about">
<h2>关于我</h2>
<p>拥有多年前端开发经验,熟悉各种前端技术和框架。</p>
</section>
<section class="work-experience">
<h2>工作经验</h2>
<div class="job">
<h3>前端开发者 - 某科技公司</h3>
<p>2019年3月 - 至今</p>
<ul>
<li>负责公司产品的前端开发和维护。</li>
<li>使用React和Vue框架开发单页应用。</li>
</ul>
</div>
<!-- 更多工作经历 -->
</section>
<section class="education">
<h2>教育背景</h2>
<div class="degree">
<h3>计算机科学学士学位 - 某大学</h3>
<p>2015年9月 - 2019年6月</p>
</div>
<!-- 更多教育经历 -->
</section>
<section class="skills">
<h2>技能</h2>
<div class="skill">
<h3>HTML/CSS</h3>
<div class="progress-bar" style="width: 90%;"></div>
</div>
<div class="skill">
<h3>JavaScript</h3>
<div class="progress-bar" style="width: 85%;"></div>
</div>
<!-- 更多技能 -->
</section>
<footer class="resume-footer">
<p>© 2024 张三. 版权所有.</p>
</footer>
</body>
</html>
CSS样式 (styles.css
)
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
color: #333;
background: #f4f4f4;
margin: 0;
padding: 20px;
box-sizing: border-box;
}
.resume-header {
text-align: center;
padding: 50px 0;
background: #007bff;
color: #fff;
}
.resume-header h1 {
margin: 0;
}
.contact-info a {
color: #fff;
text-decoration: none;
}
.about, .work-experience, .education, .skills {
margin-bottom: 40px;
}
section h2 {
color: #007bff;
border-bottom: 2px solid #007bff;
padding-bottom: 10px;
margin-bottom: 20px;
}
.job, .degree {
background: #fff;
padding: 20px;
margin-bottom: 20px;
}
.progress-bar {
height: 20px;
background: #007bff;
position: relative;
}
.skill h3 {
margin-bottom: 5px;
}
.resume-footer {
text-align: center;
padding: 20px 0;
background: #333;
color: #fff;
}
@media (max-width: 768px) {
.resume-header {
padding: 30px 0;
}
section h2 {
margin-left: 10px;
}
.job, .degree {
padding: 15px;
}
}
代码解释:
- 页面布局:使用
.resume-header
定义了简历的头部,包括个人信息和联系方式。 - 关于我、工作经验、教育背景和技能:这些部分通过
section
元素组织,每个部分都有自己的标题和内容。 - 技能条:
.progress-bar
用于展示技能掌握程度的进度条,通过内联样式控制宽度。 - 响应式设计:使用媒体查询为小屏幕设备调整了元素的布局和间距。
这个案例演示了如何使用HTML和CSS创建一个具有专业外观的个人简历网页。通过这个案例,你可以了解如何组织内容、使用颜色和布局来提升简历的视觉效果,并实现响应式设计以适应不同设备的屏幕尺寸。