<!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>© 2023 示例页面</p>
</footer>
</body>
</html>
HTML 结构:
header:包含页面标题。main:主要内容区域,包含多个 section 元素。footer:页面底部信息。CSS 样式:
<style> 标签来定义样式。box-shadow 和 border-radius 来增加视觉效果。footer 被固定在页面底部。上一篇:html输入框
下一篇:html语言中的转行标记是
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站