基础入门版(简洁单页)

这个版本非常简单,适合初学者快速上手,包含基本的结构和一些简单的样式。

个人简介网页代码html5
(图片来源网络,侵删)

特点:

  • 结构清晰,使用语义化标签 (<header>, <main>, <section>, <footer>)。
  • 内嵌CSS样式,方便修改。
  • 包含个人信息、技能和联系方式。

index.html 代码

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">张三的个人简介</title>
    <style>
        /* 全局样式 */
        body {
            font-family: 'Helvetica Neue', 'Arial', sans-serif;
            line-height: 1.6;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
            color: #333;
        }
        /* 头部样式 */
        header {
            background: #333;
            color: #fff;
            text-align: center;
            padding: 1rem 0;
        }
        header h1 {
            margin: 0;
        }
        /* 主要内容区域 */
        main {
            max-width: 800px;
            margin: 2rem auto;
            padding: 1rem;
            background: #fff;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        /* 区块通用样式 */
        section {
            margin-bottom: 2rem;
        }
        section h2 {
            border-bottom: 2px solid #333;
            padding-bottom: 0.5rem;
        }
        /* 技能列表样式 */
        .skills ul {
            list-style-type: none;
            padding: 0;
        }
        .skills li {
            background: #e9e9e9;
            margin: 0.5rem 0;
            padding: 0.5rem;
            border-left: 5px solid #333;
        }
        /* 页脚样式 */
        footer {
            text-align: center;
            padding: 1rem;
            margin-top: 2rem;
            background: #333;
            color: #fff;
        }
    </style>
</head>
<body>
    <header>
        <h1>张三</h1>
        <p>一名充满热情的前端开发工程师</p>
    </header>
    <main>
        <section id="about">
            <h2>关于我</h2>
            <p>
                你好!我是张三,一名专注于创建优雅、高效用户界面的前端开发工程师,我热爱编程,享受将复杂问题转化为简洁、直观的数字解决方案的过程。
                拥有3年的Web开发经验,熟练掌握现代前端技术栈。
            </p>
        </section>
        <section id="skills" class="skills">
            <h2>专业技能</h2>
            <ul>
                <li>HTML5, CSS3, JavaScript (ES6+)</li>
                <li>React.js, Vue.js</li>
                <li>响应式设计与移动端开发</li>
                <li>Git, Webpack, npm</li>
            </ul>
        </section>
        <section id="contact">
            <h2>联系方式</h2>
            <p>邮箱: <a href="mailto:zhangsan@example.com">zhangsan@example.com</a></p>
            <p>GitHub: <a href="https://github.com/zhangsan" target="_blank">github.com/zhangsan</a></p>
        </section>
    </main>
    <footer>
        <p>&copy; 2025 张三. All rights reserved.</p>
    </footer>
</body>
</html>

现代专业版(带导航和布局)

这个版本更专业,包含固定导航栏、更现代的布局(使用Flexbox)和更丰富的内容模块。

特点:

  • 固定导航栏: 滚动页面时导航栏始终可见。
  • Flexbox布局: 使内容排列更灵活、现代。
  • 分栏布局: 技能部分使用分栏展示,更美观。
  • 作品集模块: 展示项目经验。
  • 响应式设计: 在小屏幕设备上(如手机)也能良好显示。

index.html 代码

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">李四 - 全栈工程师</title>
    <style>
        /* 全局重置和变量 */
        :root {
            --primary-color: #0056b3;
            --secondary-color: #f4f4f4;
            --text-color: #333;
            --light-text: #e0e0e0;
        }
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            background-color: #fff;
            color: var(--text-color);
        }
        /* 导航栏样式 */
        nav {
            background: var(--primary-color);
            color: #fff;
            padding: 1rem 0;
            position: fixed;
            width: 100%;
            top: 0;
            z-index: 1000;
        }
        nav .container {
            max-width: 1100px;
            margin: 0 auto;
            padding: 0 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        nav ul {
            list-style: none;
            display: flex;
        }
        nav ul li a {
            color: #fff;
            text-decoration: none;
            padding: 0.5rem 1rem;
            transition: background 0.3s ease;
        }
        nav ul li a:hover {
            background: rgba(255,255,255,0.1);
        }
        /* 主要内容区域 */
        main {
            margin-top: 60px; /* 为固定导航栏留出空间 */
        }
        .container {
            max-width: 1100px;
            margin: auto;
            overflow: hidden;
            padding: 2rem;
        }
        /* Hero 区域 */
        .hero {
            background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1555066931-4365d14bab8c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1770&q=80') no-repeat center center/cover;
            color: #fff;
            text-align: center;
            padding: 8rem 1rem;
        }
        .hero h1 {
            font-size: 3rem;
            margin-bottom: 1rem;
        }
        .hero p {
            font-size: 1.5rem;
            margin-bottom: 2rem;
        }
        /* 通用区块样式 */
        section {
            padding: 3rem 0;
        }
        section h2 {
            font-size: 2.5rem;
            text-align: center;
            margin-bottom: 2rem;
            color: var(--primary-color);
        }
        /* 关于我区块 */
        #about {
            background: var(--secondary-color);
        }
        .about-content {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
        }
        .about-text {
            flex: 1;
            min-width: 300px;
            padding-right: 2rem;
        }
        .about-img {
            flex: 1;
            min-width: 300px;
            text-align: center;
        }
        .about-img img {
            width: 250px;
            height: 250px;
            border-radius: 50%;
            object-fit: cover;
            border: 5px solid var(--primary-color);
        }
        /* 技能区块 */
        .skills-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1.5rem;
            text-align: center;
        }
        .skill-card {
            background: #fff;
            padding: 1.5rem;
            border-radius: 5px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            transition: transform 0.3s ease;
        }
        .skill-card:hover {
            transform: translateY(-10px);
        }
        .skill-card i {
            font-size: 3rem;
            color: var(--primary-color);
            margin-bottom: 1rem;
        }
        /* 作品集区块 */
        .portfolio-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 2rem;
        }
        .portfolio-item {
            background: #fff;
            border: 1px solid #ddd;
            border-radius: 5px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
        .portfolio-item img {
            width: 100%;
            height: 200px;
            object-fit: cover;
        }
        .portfolio-content {
            padding: 1.5rem;
        }
        .portfolio-content h3 {
            margin-bottom: 0.5rem;
        }
        /* 页脚样式 */
        footer {
            background: #333;
            color: #fff;
            text-align: center;
            padding: 2rem 0;
        }
    </style>
</head>
<body>
    <nav>
        <div class="container">
            <h1>李四</h1>
            <ul>
                <li><a href="#about">关于我</a></li>
                <li><a href="#skills">技能</a></li>
                <li><a href="#portfolio">作品集</a></li>
                <li><a href="#contact">联系我</a></li>
            </ul>
        </div>
    </nav>
    <main>
        <section class="hero">
            <div class="container">
                <h1>你好,我是李四</h1>
                <p>一名热爱技术的全栈软件工程师</p>
            </div>
        </section>
        <section id="about">
            <div class="container">
                <h2>关于我</h2>
                <div class="about-content">
                    <div class="about-text">
                        <p>
                            拥有5年以上的软件开发经验,专注于使用现代化的技术栈构建高性能、可扩展的Web应用程序。
                            我热衷于学习新技术,并致力于编写干净、可维护的代码。
                        </p>
                    </div>
                    <div class="about-img">
                        <!-- 替换为你的照片 -->
                        <img src="https://i.pravatar.cc/250" alt="李四的头像">
                    </div>
                </div>
            </div>
        </section>
        <section id="skills">
            <div class="container">
                <h2>专业技能</h2>
                <div class="skills-grid">
                    <div class="skill-card">
                        <h3>前端开发</h3>
                        <p>精通 React, Vue, Angular 等主流框架,熟悉 TypeScript, Webpack, Sass 等工具链。</p>
                    </div>
                    <div class="skill-card">
                        <h3>后端开发</h3>
                        <p>熟练使用 Node.js, Python (Django/Flask) 进行服务端开发,理解 RESTful API 设计。</p>
                    </div>
                    <div class="skill-card">
                        <h3>数据库与云服务</h3>
                        <p>熟悉 MySQL, MongoDB, Redis 等数据库,以及 AWS, Docker, Kubernetes 等云原生技术。</p>
                    </div>
                </div>
            </div>
        </section>
        <section id="portfolio">
            <div class="container">
                <h2>作品集</h2>
                <div class="portfolio-grid">
                    <div class="portfolio-item">
                        <img src="https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1770&q=80" alt="电商平台项目">
                        <div class="portfolio-content">
                            <h3>大型电商平台</h3>
                            <p>使用 React 和 Node.js 构建的全栈电商解决方案,支持高并发和实时库存管理。</p>
                        </div>
                    </div>
                    <div class="portfolio-item">
                        <img src="https://images.unsplash.com/photo-1555066931-4365d14bab8c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1770&q=80" alt="数据可视化项目">
                        <div class="portfolio-content">
                            <h3>企业级数据看板</h3>
                            <p>基于 Vue 和 ECharts 的数据可视化平台,帮助企业实时监控核心业务指标。</p>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <section id="contact">
            <div class="container">
                <h2>联系我</h2>
                <p style="text-align: center;">如果你对我的工作感兴趣,欢迎随时通过以下方式联系我。</p>
                <p style="text-align: center;">邮箱: <a href="mailto:lisi@example.com">lisi@example.com</a></p>
                <p style="text-align: center;">GitHub: <a href="https://github.com/lisi" target="_blank">github.com/lisi</a></p>
            </div>
        </section>
    </main>
    <footer>
        <div class="container">
            <p>&copy; 2025 李四. All rights reserved.</p>
        </div>
    </footer>
</body>
</html>

如何使用和修改这些代码

  1. 复制代码: 将上面任一示例的完整代码复制到一个文本编辑器中(如 VS Code, Sublime Text, 或者记事本)。
  2. 保存文件: 将文件另存为 index.html,确保文件扩展名是 .html
  3. 在代码中找到你需要修改的部分,
    • 标题和姓名: 修改 <title> 标签和 <h1> 标签中的文字。
    • 个人信息:<p> 标签中修改你的自我介绍、技能列表、项目描述等。
    • 链接和图片:
      • 修改邮箱链接 <a href="mailto:your_email@example.com">
      • 修改GitHub链接 <a href="https://github.com/your_username">
      • 替换图片: 找到 <img src="..."> 标签,将 src 属性中的链接替换为你自己上传的图片链接(将图片上传到你的GitHub仓库、图床或其他服务器,然后获取其URL)。
  4. 预览效果:
    • 直接打开: 用浏览器(如 Chrome, Firefox, Edge)直接打开保存好的 index.html 文件,即可看到效果。
    • 本地服务器: 如果你想测试像导航栏滚动这样的交互效果,最好使用一个简单的本地服务器,在 VS Code 中,你可以安装 "Live Server" 插件,然后右键点击 index.html 文件,选择 "Open with Live Server"。

进阶建议

  • CSS框架: 如果你想快速构建更美观、响应式的页面,可以学习使用 CSS 框架,如 BootstrapTailwind CSS,它们提供了大量预先设计好的样式和组件。
  • JavaScript交互: 添加一些 JavaScript 可以让你的网页更生动,
    • 平滑滚动: 点击导航链接时,页面平滑地滚动到对应部分,而不是跳转。
    • 动态效果: 鼠标悬停时显示更多项目信息,或者实现一个打字机效果来显示你的职业。
  • 部署上线: 当你的个人简介网页完成后,可以将其部署到网上,让别人随时访问,GitHub Pages 是一个非常免费且方便的选择,只需将你的代码上传到 GitHub 仓库,然后开启 Pages 功能即可。

希望这些示例能帮助你创建出属于自己的精彩个人简介网页!

个人简介网页代码html5
(图片来源网络,侵删)