【HTML】个人博客页面

news2025/5/18 14:12:51

目录

页面视图​编辑

页面代码


解释:

  1. HTML (<body>):

    • 使用了更加语义化的HTML5标签,例如<header>, <main>, <article>, <footer>
    • 文章列表使用了<article>包裹,结构清晰。
    • 添加了分页导航。
    • 使用了Font Awesome图标,记得替换your-font-awesome-kit.js为你的项目中的Font Awesome。
  2. CSS (<style>):

    • 使用了Noto Serif SC作为主要字体,这是一种衬线字体,更适合博客的风格。
    • 整体颜色方案更加清新自然,使用了绿色的主色调。
    • 对header和footer进行了美化,增加了阴影和过渡效果。
    • 文章列表和侧边栏的样式更加精致,使用了圆角和更柔和的阴影。
    • 增加了更多的hover效果,例如链接下划线动画、按钮和文章的轻微上移效果。
    • 使用了Flexbox布局,使页面结构更加灵活。
    • 添加了响应式设计,在移动设备上也能有良好的浏览体验。
  3. JavaScript (<script>):

    • 包含了平滑滚动效果,点击#开头的链接时页面会平滑滚动到对应位置。

如何使用:

  1. 将代码保存为HTML文件(例如 index.html)。
  2. 在浏览器中打开该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>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Noto Serif SC', serif; /* 使用 Noto Serif SC */
            margin: 0;
            padding: 0;
            background-color: #f8f8f8;
            color: #333;
            line-height: 1.7; /* 增加默认行高 */
        }

        .container {
            max-width: 1200px; /* 增大最大宽度 */
            margin: 40px auto; /* 增加上下外边距 */
            padding: 0 30px; /* 增加左右内边距 */
        }

        header {
            background-color: #4CAF50; /* 更现代的颜色 */
            color: white;
            padding: 25px 0; /* 增加padding */
            margin-bottom: 60px; /* 增加下外边距 */
            box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* 增加阴影 */
        }

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

        .logo {
            font-size: 2.2em; /* 增大logo字体 */
            font-weight: bold;
            transition: transform 0.2s ease-in-out; /* 添加过渡效果 */
        }

        .logo:hover {
            transform: scale(1.05); /* 放大效果 */
        }

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

        nav ul li {
            margin-left: 30px; /* 增加间距 */
        }

        nav ul li a {
            color: white;
            text-decoration: none;
            font-size: 1.1em; /* 增加字体大小 */
            transition: color 0.3s ease; /* 平滑过渡 */
            position: relative; /* 为了下划线动画 */
            padding-bottom: 5px; /* 为下划线留出空间 */
        }

        nav ul li a:hover {
            color: #f1f1f1; /* 稍微改变hover颜色 */
        }

        nav ul li a::after { /* 添加下划线 */
            content: '';
            display: block;
            width: 0;
            height: 2px;
            background: white;
            position: absolute;
            left: 0;
            bottom: 0;
            transition: width 0.3s ease; /* 下划线过渡效果 */
        }

        nav ul li a:hover::after {
            width: 100%; /* 鼠标悬停时显示完整下划线 */
        }

        main {
            display: flex;
            gap: 40px; /* 增加gap */
        }

        .sidebar {
            flex: 0 0 300px; /* 增大宽度 */
        }

        .content {
            flex: 1;
        }

        .widget {
            background: white;
            padding: 30px; /* 增加padding */
            margin-bottom: 40px; /* 增加margin */
            border-radius: 8px; /* 增加圆角 */
            box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* 增加阴影 */
            transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; /* 添加过渡 */
        }

        .widget:hover {
            transform: translateY(-4px); /* 轻微上移 */
            box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* 改变阴影 */
        }


        .widget h3 {
            margin-top: 0;
            margin-bottom: 25px; /* 增加下边距 */
            font-size: 1.5em; /* 增大字号 */
            color: #4CAF50; /* 主题色 */
            border-bottom: 2px solid #e0e0e0;
            padding-bottom: 10px;
        }

        .widget ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .widget ul li {
            padding: 15px 0; /* 增加padding */
            border-bottom: 1px solid #e0e0e0;
            transition: background-color 0.3s ease; /* 添加背景色过渡 */
        }

        .widget ul li:last-child {
            border-bottom: none;
        }

        .widget ul li:hover {
            background-color: #f0f0f0; /* 淡灰色hover效果 */
            padding-left: 10px; /* 增加左内边距,提供反馈 */
        }

        .widget ul li a {
            color: #333;
            text-decoration: none;
            display: block; /* 使整个li可点击 */
            font-size: 1.1em;
        }

        .post {
            background: white;
            padding: 30px; /* 增加padding */
            margin-bottom: 40px; /* 增加margin */
            border-radius: 8px; /* 增加圆角 */
            box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* 增加阴影 */
        }

        .post h2 {
            margin-top: 0;
            margin-bottom: 15px; /* 增加下边距 */
            font-size: 2em; /* 增大字号 */
            color: #2c3e50; /* 深色标题 */
            transition: color 0.3s ease;
        }

        .post h2:hover {
            color: #4CAF50; /* 鼠标悬停时改变颜色 */
        }

        .post .post-meta {
            color: #7f8c8d;
            font-size: 0.95em; /* 稍微增大 */
            margin-bottom: 20px; /* 增加下边距 */
            display: flex; /* 使用flex布局 */
            align-items: center; /* 垂直居中 */
            gap: 10px; /* 增加作者和日期之间的间距 */
        }

        .post .post-meta i { /* 使用图标,例如Font Awesome */
            margin-right: 5px;
            color: #95a5a6; /* 更柔和的颜色 */
        }

        .post p {
            font-size: 1.1em; /* 增大默认字号 */
            line-height: 1.8; /* 增加行高 */
            color: #444; /* 稍微深一点的颜色 */
            margin-bottom: 25px; /* 增加段落间距 */
        }

        .read-more {
            display: inline-block;
            background-color: #4CAF50;
            color: white;
            padding: 12px 25px; /* 增加padding */
            text-decoration: none;
            border-radius: 6px; /* 稍微减小圆角 */
            margin-top: 15px; /* 增加上边距 */
            transition: background-color 0.3s ease, transform 0.2s ease; /* 添加过渡 */
            font-size: 1.1em;
        }

        .read-more:hover {
            background-color: #45a049;
            transform: translateY(-2px); /* 轻微上移 */
        }

        .pagination { /* 分页样式 */
            display: flex;
            justify-content: center;
            margin-top: 40px;
            margin-bottom: 20px;
        }

        .pagination a, .pagination span {
            padding: 10px 18px;
            margin: 0 5px;
            border-radius: 5px;
            text-decoration: none;
            color: #3498db;
            background-color: #ecf0f1;
            transition: background-color 0.3s ease, color 0.3s ease;
            font-size: 1.1em;
        }

        .pagination a:hover {
            background-color: #3498db;
            color: white;
        }

        .pagination .current {
            background-color: #3498db;
            color: white;
        }

        footer {
            background-color: #2c3e50;
            color: white;
            text-align: center;
            padding: 30px 0; /* 增加padding */
            margin-top: 60px; /* 增加margin */
            border-top: 1px solid #34495e;
            border-radius: 8px 8px 0 0; /* 上圆角 */
        }

        footer .container {
            display: flex;
            justify-content: center; /* Center content horizontally */
            align-items: center;
        }

        footer p{
            font-size: 1.1em;
        }


        /* 移动端响应式 */
        @media (max-width: 768px) {
            .container {
                padding: 15px;
            }

            header .container {
                flex-direction: column;
                text-align: center;
            }

            .logo {
                margin-bottom: 20px;
            }

            nav ul {
                flex-direction: column;
                align-items: center;
            }

            nav ul li {
                margin-left: 0;
                margin-top: 15px;
            }

            main {
                flex-direction: column;
            }

            .sidebar {
                width: 100%;
                margin-bottom: 40px;
            }

            .widget {
                padding: 20px;
            }

            .post {
                padding: 20px;
            }
        }

        /* 更小的屏幕 */
        @media (max-width: 480px) {
            .logo {
                font-size: 1.8em;
            }

            nav ul li a {
                font-size: 1em;
            }

            .post h2 {
                font-size: 1.5em;
            }

            .read-more {
                font-size: 1em;
                padding: 10px 20px;
            }

            .widget h3{
                font-size: 1.2em;
            }
        }
    </style>
</head>
<body>
    <header>
        <div class="container">
            <div class="logo">我的博客</div>
            <nav>
                <ul>
                    <li><a href="#">首页</a></li>
                    <li><a href="#">关于我</a></li>
                    <li><a href="#">文章</a></li>
                    <li><a href="#">作品</a></li>
                    <li><a href="#">联系</a></li>
                </ul>
            </nav>
        </div>
    </header>

    <main class="container">
        <div class="sidebar">
            <div class="widget">
                <h3>最新文章</h3>
                <ul>
                    <li><a href="#">文章标题一</a></li>
                    <li><a href="#">文章标题二</a></li>
                    <li><a href="#">文章标题三</a></li>
                </ul>
            </div>
            <div class="widget">
                <h3>分类</h3>
                <ul>
                    <li><a href="#">技术</a></li>
                    <li><a href="#">生活</a></li>
                    <li><a href="#">旅行</a></li>
                    <li><a href="#">摄影</a></li>
                </ul>
            </div>
            <div class="widget">
                <h3>友情链接</h3>
                <ul>
                    <li><a href="#">朋友的博客</a></li>
                    <li><a href="#">推荐网站</a></li>
                </ul>
            </div>
        </div>
        <div class="content">
            <article class="post">
                <h2>文章标题一:探索未知的领域</h2>
                <p class="post-meta">
                    <i class="far fa-calendar-alt"></i> 2024年5月20日
                    <i class="fas fa-user"></i> 作者:您的名字
                </p>
                <p>
                    这是一篇关于探索未知领域的文章,我们将在本文中深入探讨一些有趣的话题,
                    例如人工智能的未来发展、宇宙的奥秘以及人类的进化。探索未知是人类的天性,
                    让我们一起踏上这段激动人心的旅程。
                </p>
                <p>
                    我们还将分享一些实用的技巧和工具,帮助您更好地进行研究和学习。
                    希望这篇文章能够激发您对知识的渴望,并鼓励您勇敢地追求自己的梦想。
                </p>
                <a href="#" class="read-more"></a>
            </article>

            <article class="post">
                <h2>文章标题二:记录生活中的美好瞬间</h2>
                <p class="post-meta">
                    <i class="far fa-calendar-alt"></i> 2024年5月18日
                    <i class="fas fa-user"></i> 作者:您的名字
                </p>
                <p>
                    生活就像一本精彩的书,而我们就是书中的主角。这篇文章将带您一起回顾那些
                    生活中的美好瞬间,例如旅行中的风景、与朋友的聚会以及那些令人难忘的时刻。
                </p>
                <p>
                    我们相信,记录生活中的美好瞬间可以帮助我们更好地珍惜现在,
                    并为未来的生活增添色彩。希望这篇文章能够触动您内心深处的情感,
                    并鼓励您勇敢地去创造更多美好的回忆。
                </p>
                <a href="#" class="read-more"></a>
            </article>
            <div class="pagination">
                <span class="current">1</span>
                <a href="#">2</a>
                <a href="#">3</a>
                <a href="#">下一页</a>
            </div>
        </div>
    </main>

    <footer>
        <div class="container">
            <p>&copy; 2024 我的博客. All rights reserved. | Design by Your Name</p>
        </div>
    </footer>

    <script>
        // JavaScript 可以在这里添加交互功能,例如平滑滚动、移动端菜单等
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();

                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });
    </script>
    <script src="https://kit.fontawesome.com/your-font-awesome-kit.js" crossorigin="anonymous"></script>
</body>
</html>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2378552.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

论文解读:ICLR2025 | D-FINE

[2410.13842] D-FINE: Redefine Regression Task in DETRs as Fine-grained Distribution Refinement D-FINE 是一款功能强大的实时物体检测器&#xff0c;它将 DETRs 中的边界框回归任务重新定义为细粒度分布细化&#xff08;FDR&#xff09;&#xff0c;并引入了全局最优定位…

9.DMA

目录 DMA —为 CPU 减负 DMA 的简介和使用场景 DMA 的例子讲解 STM32 的 DMA 框图和主要特性 ​编辑 DMA 的通道的对应通道外设 – DMA 和哪些外设使用 ​编辑​编辑ADC_DR 寄存器地址的计算 常见的数据滤波方法 ADCDMA 的编程 DMA —为 CPU 减负 DMA 的简介和使用场…

大语言模型 10 - 从0开始训练GPT 0.25B参数量 补充知识之模型架构 MoE、ReLU、FFN、MixFFN

写在前面 GPT&#xff08;Generative Pre-trained Transformer&#xff09;是目前最广泛应用的大语言模型架构之一&#xff0c;其强大的自然语言理解与生成能力背后&#xff0c;是一个庞大而精细的训练流程。本文将从宏观到微观&#xff0c;系统讲解GPT的训练过程&#xff0c;…

python基础语法(三-中)

基础语法3&#xff1a; 2.列表与元组&#xff1a; <1>.列表、元组是什么&#xff1f; 都用来存储数据&#xff0c;但是两者有区别&#xff0c;列表可变&#xff0c;元组不可变。 <2>.创建列表&#xff1a; 创建列表有两种方式&#xff1a; [1].a 【】&#x…

ZTE 7551N 中兴小鲜60 远航60 努比亚小牛 解锁BL 刷机包 刷root 展讯 T760 bl

ZTE 7551N 中兴小鲜60 远航60 努比亚小牛 解锁BL 刷机包 刷root 3款机型是一个型号&#xff0c;包通用&#xff0c; ro.product.system.modelZTE 7551N ro.product.system.nameCN_P720S15 #################################### # from generate-common-build-props # Th…

信息系统项目管理师高级-软考高项案例分析备考指南(2023年案例分析)

个人笔记整理---仅供参考 计算题 案例分析里的计算题就是进度、挣值分析、预测技术。主要考査的知识点有:找关键路径、求总工期、自由时差、总时差、进度压缩资源平滑、挣值计算、预测计算。计算题是一定要拿下的&#xff0c;做计算题要保持头脑清晰&#xff0c;认真读题把PV、…

产品经理入门(2)产品体验报告

产品体验报告大纲&#xff1a;重点在产品体验——优点。 1.产品概括 可以从各大平台搜产品介绍。 2.市场分析 按照产品方向分析各个指标——包括有效使用时间,市场规模等。 3. 用户分析——对用户通过各项指标画像。 4.产品体验——对各项功能与设计的体验。 5.报告总结

C43-指针与数组

一 定义一个指针变量指向数组 1.途径一:指向数组首元素的地址 代码示例: #include <stdio.h> int main() {int arr[3]{2,4,5};int *p;p&arr[0];printf("该数组的首元素是:%d",*p);return 0; }成果展示: 报错与总结: 给指针变量赋值时,未在数组首元素前输…

UDP--DDR--SFP,FPGA实现之ddr读写控制模块

DDR读写控制模块实现介绍 由于该模块接口数量较多&#xff0c;为了详细说明模块实现&#xff0c;采用文字流程进行介绍 上级模块传输数据到来捕捉数据有效上升沿传输写指令&#xff0c;写有效&#xff0c;写指令成功被下一级模块缓存&#xff0c;进行写地址一次读写长度&…

云计算与大数据进阶 | 26、解锁云架构核心:深度解析可扩展数据库的5大策略与挑战(上)

在云应用/服务的 5 层架构里&#xff0c;数据库服务层稳坐第 4 把交椅&#xff0c;堪称其中的 “硬核担当”。它的复杂程度常常让人望而生畏&#xff0c;不少人都将它视为整个架构中的 “终极挑战”。 不过&#xff0c;也有人觉得可扩展存储系统才是最难啃的 “硬骨头”&#…

AI Agent | Coze 插件使用指南:从功能解析到实操步骤

一、前言 在人工智能技术飞速发展的今天&#xff0c;低代码开发模式正成为构建智能应用的主流趋势。对于希望快速搭建 AI Bot 的开发者和业务人员而言&#xff0c;coze作为一款强大的低代码 AI 开发平台&#xff0c;凭借其高度模块化的插件体系脱颖而出。这些插件就像搭建智能…

MK米客方德SD NAND:无人机存储的高效解决方案

在无人机技术迅猛发展的当下&#xff0c;飞控系统的数据记录对于飞行性能剖析、故障排查以及飞行安全保障极为关键。以往&#xff0c;SD 卡是飞控 LOG 记录常见的存储介质&#xff0c;但随着技术的革新&#xff0c;新的存储方案不断涌现。本文聚焦于以 ESP32 芯片为主控制器的无…

【vscode】解决vscode无法安装远程服务器插件问题,显示正在安装

文章目录 现状分析采用VSIX离线安装第一步&#xff1a;离线下载插件包第二步&#xff1a;把下载好的插件文件上传到远程服务器上第三步&#xff1a;在windows下打开vscode&#xff0c;并链接远端&#xff0c;进行安装 现状分析 vscode无法远程安装扩展插件&#xff0c;显示正在…

【Spring】Spring的请求处理

欢迎来到啾啾的博客&#x1f431;。 记录学习点滴。分享工作思考和实用技巧&#xff0c;偶尔也分享一些杂谈&#x1f4ac;。 欢迎评论交流&#xff0c;感谢您的阅读&#x1f604;。 目录 引言HTTP/HTTPS协议Spring Web与Spring Web MVCSpring WebFlux 自定义的TPC/IP协议FTP、S…

粒子群算法(PSO算法)

粒子群算法概述 1.粒子群优化算法&#xff08;Particle Swarm Optimization&#xff0c;简称PSO&#xff09;。粒子群优化算法是在1995年由Kennedy博士和Eberhart博士一起提出的&#xff0c;它源于对鸟群捕食行为的研究。 2.基本核心是利用群体中的个体对信息的共享从而使得整…

LLM智能体新纪元:深入解析MCP与A2A协议,赋能智能自动化协作

LLM智能体&#xff08;LLM agents&#xff09;是能够自主行动以实现特定目标的AI系统。在实际应用中&#xff0c;智能体能够将用户请求拆解为多个步骤&#xff0c;利用知识库或API获取数据&#xff0c;最终整合出答案。这让智能体相比于传统独立聊天机器人拥有更强大的能力——…

SAP学习笔记 - 开发豆知识01 - CDS SDK命令出乱码 (cds init CAP-Test03 --add java)

1&#xff0c;现象 安装完VSCode以及各种需要的插件&#xff08;比如SAP CDS Language Support&#xff09;&#xff0c;就可以做CAP开发。 用这个命令创建Project&#xff1a;cds init CAP-Test03 --add java 然后出来一个乱码错误 adding java The derived package name c…

(C语言)超市管理系统 (正式版)(指针)(数据结构)(清屏操作)(文件读写)(网页版预告)(html)(js)(json)

目录 前言&#xff1a; 源代码&#xff1a; product.h product.c fileio.h fileio.c main.c json_export.h json_export.c tasks.json idex.html script.js 相关步骤&#xff1a; 第一步&#xff1a; 第二步&#xff1a; 第三步&#xff1a; 第四步&#xff1a; 第五步…

进阶-数据结构部分:​​​​​​​2、常用排序算法

飞书文档https://x509p6c8to.feishu.cn/wiki/FfpIwIPtviMMb4kAn3Sc40ABnUh 常用排序算法 这几种算法都是常见的排序算法&#xff0c;它们的优劣和适用场景如下&#xff1a; 冒泡排序&#xff08;Bubble Sort&#xff09;&#xff1a;简单易懂&#xff0c;时间复杂度较高&…

25、DeepSeek-R1论文笔记

DeepSeek-R1论文笔记 1、研究背景与核心目标2、核心模型与技术路线3、蒸馏技术与小模型优化4、训练过程简介5、COT思维链&#xff08;Chain of Thought&#xff09;6、强化学习算法&#xff08;GRPO&#xff09;7、冷启动**1. 冷启动的目的****2. 冷启动的实现步骤****3. 冷启动…