Laravel  
laravel
文档
数据库
架构
入门
php技术
    
Laravelphp
laravel / php / java / vue / mysql / linux / python / javascript / html / css / c++ / c#

个人博客网页设计html代码

作者:氵冗氵孚   发布日期:2025-12-21   浏览:37

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人博客</title>
    <style>
        /* 简单的样式,使页面看起来更美观 */
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
        }
        header {
            background-color: #4CAF50;
            color: white;
            padding: 10px 0;
            text-align: center;
        }
        nav {
            display: flex;
            justify-content: center;
            background-color: #333;
        }
        nav a {
            color: white;
            padding: 14px 20px;
            text-decoration: none;
            text-align: center;
        }
        nav a:hover {
            background-color: #ddd;
            color: black;
        }
        .container {
            padding: 20px;
        }
        footer {
            background-color: #333;
            color: white;
            text-align: center;
            padding: 10px 0;
            position: fixed;
            bottom: 0;
            width: 100%;
        }
    </style>
</head>
<body>
    <header>
        <h1>欢迎来到我的个人博客</h1>
    </header>
    <nav>
        <a href="#home">首页</a>
        <a href="#about">关于我</a>
        <a href="#articles">文章</a>
        <a href="#contact">联系我</a>
    </nav>
    <div class="container">
        <h2>最新文章</h2>
        <article>
            <h3>文章标题1</h3>
            <p>这是第一篇文章的内容。你可以在这里写一些有趣的事情。</p>
        </article>
        <article>
            <h3>文章标题2</h3>
            <p>这是第二篇文章的内容。你可以在这里写一些有趣的事情。</p>
        </article>
    </div>
    <footer>
        <p>&copy; 2023 我的个人博客</p>
    </footer>
</body>
</html>

解释说明:

  1. HTML结构

    • <!DOCTYPE html>:声明文档类型为HTML5。
    • <html lang="zh-CN">:指定语言为简体中文。
    • <head>:包含元数据、字符集声明、视口设置和页面标题。
    • <body>:页面的主要内容部分。
  2. CSS样式

    • 使用内联样式(<style>标签)来定义页面的基本样式,包括字体、背景颜色、布局等。
    • headernavfooter等元素分别定义了页面的头部、导航栏和底部区域。
    • nav a定义了导航链接的样式,并设置了悬停效果。
  3. 页面内容

    • header中包含一个欢迎标题。
    • nav中包含四个导航链接,分别指向不同的页面或锚点。
    • container中包含两个示例文章,每个文章有一个标题和一段简短的内容。
    • footer中包含版权信息,并固定在页面底部。

这个代码提供了一个简单的个人博客网页模板,你可以根据需要进行修改和扩展。

上一篇:html代码在线运行

下一篇:html下拉菜单

大家都在看

静态html源码

404 html

ios打开html

nginx访问不到html

html 符号

colspan在html中是什么意思

怎么将网页另存为html

xml转html

html时间代码

html localstorage

Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3

Laravel 中文站