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

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

http://www.lryc.cn/news/2396590.html

相关文章:

  • Mac电脑上本地安装 MySQL并配置开启自启完整流程
  • JavaSE:面向对象进阶之内部类(Inner Class)
  • 【HW系列】—安全设备介绍(开源蜜罐的安装以及使用指南)
  • 汽车总线分析总结(CAN、LIN、FlexRay、MOST、车载以太网)
  • MyBatisPlus--条件构造器及自定义SQL详解
  • OVD开放词汇检测 Detic 训练COCO数据集实践
  • docker、ctr、crictl命令简介与使用
  • WEB安全--SQL注入--bypass技巧2
  • 【强化学习哲学 Day 1】Q-Learning - 在不确定中寻找确定
  • WEB3——什么是ABI
  • 嵌入式软件--stm32 DAY 8.5 基础复习总结
  • MMRL: Multi-Modal Representation Learning for Vision-Language Models(多模态表示学习)
  • 贪心算法求解汽车加油问题
  • JVM Full GC 频繁问题排查、优化及解决方案
  • rsync服务的搭建
  • JDK21深度解密 Day 8:Spring Boot 3与虚拟线程整合
  • vscode 配置 QtCreat Cmake项目
  • 排序算法-归并排序与快速排序
  • HTML实现端午节主题网站:龙舟争渡,凭吊祭江诵君赋。
  • uniapp uni-id 如果是正式项目,需自行实现发送邮件的相关功能
  • Spring boot 策略模式
  • websocket在vue中的使用步骤,以及实现聊天
  • C++学习-入门到精通【12】文件处理
  • 第十一篇:MySQL 在分布式系统中的一致性保障与中间件实践
  • Java中如何枚举正则表达式捕获组的名字
  • matlab实现图像压缩编码
  • 如何排查Redis单个Key命中率骤降?
  • 记一次 Starrocks be 内存异常宕机
  • Spring Boot 读取.env文件获取配置
  • LangChain-结合GLM+SQL+函数调用实现数据库查询(一)