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

个人主页html源码

作者:最终一次颓废   发布日期:2026-03-13   浏览:61

<!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="#about">关于我</a>
        <a href="#projects">项目</a>
        <a href="#contact">联系我</a>
    </nav>
    <div class="container">
        <section id="about">
            <h2>关于我</h2>
            <p>这里是关于我的介绍。</p>
        </section>
        <section id="projects">
            <h2>项目</h2>
            <p>这里是我的一些项目。</p>
        </section>
        <section id="contact">
            <h2>联系我</h2>
            <p>可以通过以下方式联系我:email@example.com</p>
        </section>
    </div>
    <footer>
        <p>&copy; 2023 我的名字</p>
    </footer>
</body>
</html>

解释说明:

  1. HTML结构

    • <!DOCTYPE html>:声明文档类型为HTML5。
    • <html lang="zh-CN">:指定网页语言为中文。
    • <head>:包含元数据、标题和样式信息。
    • <body>:包含页面的主要内容。
  2. 头部 (<header>) 和导航栏 (<nav>)

    • 使用了简单的CSS进行样式设置,包括背景颜色、文本颜色和内边距等。
    • 导航栏使用了flexbox布局,使其居中显示。
  3. 主要内容区 (<div class="container">)

    • 包含三个部分:关于我、项目和联系我,每个部分用<section>标签包裹,并通过ID进行锚点链接。
  4. 页脚 (<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 中文站