<!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;
}
section {
padding: 20px;
margin: 20px;
background-color: white;
}
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="#contact">联系我</a>
</nav>
<section id="home">
<h2>首页</h2>
<p>这是我的个人网页的首页。</p>
</section>
<section id="about">
<h2>关于我</h2>
<p>这里是一些关于我的信息。</p>
</section>
<section id="contact">
<h2>联系我</h2>
<p>如果您有任何问题,可以通过以下方式联系我。</p>
</section>
<footer>
<p>© 2023 我的名字</p>
</footer>
</body>
</html>
<!DOCTYPE html>):定义文档为 HTML5 标准。<html> 标签:根元素,指定语言为中文 (lang="zh-CN").<head> 部分:<meta charset="UTF-8">:设置字符编码为 UTF-8。<meta name="viewport" content="width=device-width, initial-scale=1.0">:确保页面在移动设备上正确缩放。<title>:设置网页标题。<style>:内联 CSS 样式,用于美化页面。<body> 部分:<header>:包含网页标题和欢迎信息。<nav>:导航栏,包含链接到不同部分的按钮。<section>:不同的内容区域(如首页、关于我、联系我)。<footer>:页脚,包含版权信息。这个简单的 HTML 模板可以帮助你快速创建一个基础的个人网页。你可以根据需要进一步修改和扩展。
上一篇:html input type
下一篇:html样式
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站