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

html 美化

作者:缺爱╮不缺钙   发布日期:2026-01-28   浏览:66

<!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>
    <style>
        /* 使用 CSS 美化页面 */
        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;
        }
        main {
            padding: 20px;
        }
        section {
            background-color: white;
            margin-bottom: 20px;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        footer {
            background-color: #333;
            color: white;
            text-align: center;
            padding: 10px 0;
            position: fixed;
            bottom: 0;
            width: 100%;
        }
    </style>
</head>
<body>
    <header>
        <h1>HTML 美化示例</h1>
    </header>
    <main>
        <section>
            <h2>欢迎来到 HTML 美化页面</h2>
            <p>这是一个简单的 HTML 页面,使用了 CSS 进行美化。</p>
        </section>
        <section>
            <h2>更多内容</h2>
            <p>你可以在这里添加更多的内容和样式。</p>
        </section>
    </main>
    <footer>
        <p>&copy; 2023 示例页面</p>
    </footer>
</body>
</html>

解释说明:

  1. HTML 结构:

    • header:包含页面标题。
    • main:主要内容区域,包含多个 section 元素。
    • footer:页面底部信息。
  2. CSS 样式:

    • 使用了内联的 <style> 标签来定义样式。
    • 设置了字体、背景颜色、边距、内边距等属性,使页面看起来更加美观。
    • 使用了 box-shadowborder-radius 来增加视觉效果。
    • 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 中文站