当前位置: 首页 > news >正文

HTML实战:响应式个人资料页面

我将创建一个现代化的响应式个人资料页面,展示HTML在实际应用中的强大功能。这个页面将包含多个实战元素:导航栏、个人简介、技能展示、作品集和联系表单。

设计思路

  • 使用Flexbox和Grid布局实现响应式设计

  • 添加CSS过渡效果增强交互体验

  • 实现深色/浅色模式切换功能

  • 创建悬停动画效果提升视觉体验

  • 确保所有元素在不同设备上完美显示

下面是完整的HTML代码实现:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTML实战 - 响应式个人资料页面</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        :root {
            --primary: #4361ee;
            --secondary: #3f37c9;
            --accent: #4895ef;
            --light: #f8f9fa;
            --dark: #212529;
            --text: #333;
            --bg: #ffffff;
            --card-bg: #f8f9fa;
            --shadow: rgba(0, 0, 0, 0.1);
            --transition: all 0.3s ease;
        }

        .dark-mode {
            --primary: #4895ef;
            --secondary: #4361ee;
            --accent: #3f37c9;
            --light: #343a40;
            --dark: #f8f9fa;
            --text: #f8f9fa;
            --bg: #121212;
            --card-bg: #1e1e1e;
            --shadow: rgba(0, 0, 0, 0.3);
        }

        body {
            background-color: var(--bg);
            color: var(--text);
            line-height: 1.6;
            transition: var(--transition);
        }

        .container {
            width: 90%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* 头部样式 */
        header {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            padding: 1rem 0;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 2px 10px var(--shadow);
        }

        .header-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo {
            font-size: 1.8rem;
            font-weight: 700;
            display: flex;
            align-items: center;
        }

        .logo i {
            margin-right: 10px;
            color: var(--accent);
        }

        nav ul {
            display: flex;
            list-style: none;
        }

        nav ul li {
            margin-left: 1.5rem;
        }

        nav ul li a {
            color: white;
            text-decoration: none;
            font-weight: 500;
            padding: 8px 12px;
            border-radius: 4px;
            transition: var(--transition);
        }

        nav ul li a:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .theme-toggle {
            background: none;
            border: none;
            color: white;
            font-size: 1.2rem;
            cursor: pointer;
            margin-left: 20px;
            transition: var(--transition);
        }

        /* 英雄区域 */
        .hero {
            padding: 100px 0;
            text-align: center;
            background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1499951360447-b19be8fe80f5?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80') center/cover no-repeat;
            color: white;
        }

        .hero h1 {
            font-size: 3.5rem;
            margin-bottom: 1rem;
            animation: fadeInDown 1s ease;
        }

        .hero p {
            font-size: 1.5rem;
            max-width: 700px;
            margin: 0 auto 2rem;
            animation: fadeInUp 1s ease;
        }

        .btn {
            display: inline-block;
            background: var(--accent);
            color: white;
            padding: 12px 30px;
            border-radius: 50px;
            text-decoration: none;
            font-weight: 600;
            transition: var(--transition);
            border: 2px solid var(--accent);
            animation: fadeIn 1.5s ease;
        }

        .btn:hover {
            background: transparent;
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }

        /* 关于区域 */
        .section {
            padding: 80px 0;
        }

        .section-title {
            text-align: center;
            margin-bottom: 60px;
        }

        .section-title h2 {
            font-size: 2.5rem;
            color: var(--primary);
            position: relative;
            display: inline-block;
            padding-bottom: 15px;
        }

        .section-title h2::after {
            content: '';
            position: absolute;
            bottom: 0;
            l

相关文章:

  • 【容器】docker使用问题处理
  • Eclipse 插件开发 5.3 编辑器 监听输入
  • React Context 与状态管理:用与不用
  • 【数据分析】特征工程-特征选择
  • JS语言基础
  • 【华为战报】4月、5月 HCIP考试战报!
  • 将 AI 解答转换为 Word 文档
  • 题目 3314: 蓝桥杯2025年第十六届省赛真题-魔法科考试
  • 一篇学习CSS的笔记
  • 【深度学习】10. 深度推理(含链式法则详解)RNN, LSTM, GRU,VQA
  • 进阶知识:Selenium底层原理深度解析
  • 如何设计高效的数据湖架构:存储策略、Schema 演进与数据生命周期管理
  • Flask集成Selenium实现网页截图
  • 使用 Selenium 进行自动化测试:入门指南
  • 物流项目第九期(MongoDB的应用之作业范围)
  • 【unity游戏开发——编辑器扩展】EditorUtility编辑器工具类实现如文件操作、进度条、弹窗等操作
  • STM32学习笔记---时钟树
  • 《基于AIGC的智能化多栈开发新模式》研究报告重磅发布! ——AI重塑软件工程,多栈开发引领未来
  • PHP+MySQL开发语言 在线下单订水送水小程序源码及搭建指南
  • Kruskal算法剖析与py/cpp/Java语言实现
  • 便捷的大连网站建设/域名大全查询
  • 电商平台运营模式/深圳关键词优化怎么样
  • 在线购物的网站制作/seo主要做什么
  • 个域名的网站建设方案书/谷歌推广app
  • 从零做网站/百度关键词排名十大排名
  • 宝塔做网站安全吗/百度竞价渠道代理