<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML5 + CSS3 网页设计与制作</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;
border-radius: 8px;
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>HTML5 + CSS3 网页设计与制作</h1>
</header>
<nav>
<a href="#">首页</a>
<a href="#">关于我们</a>
<a href="#">服务</a>
<a href="#">联系我们</a>
</nav>
<section>
<h2>欢迎来到我们的网站</h2>
<p>这是一个使用 HTML5 和 CSS3 设计的简单网页示例。HTML5 提供了更多的语义化标签,而 CSS3 则提供了更强大的样式和动画功能。</p>
</section>
<footer>
<p>© 2023 我们的公司名称. 版权所有.</p>
</footer>
</body>
</html>
HTML5 结构:
<header>、<nav>、<section> 和 <footer> 等语义化标签,使页面结构更加清晰。<meta name="viewport"> 确保页面在移动设备上能够正确缩放。CSS3 样式:
flexbox 布局来实现导航栏的居中对齐。box-shadow 和 border-radius 来美化 section 区域,使其具有圆角和阴影效果。:hover 伪类来为导航链接添加悬停效果。响应式设计:
希望这个示例能帮助你理解如何使用 HTML5 和 CSS3 进行网页设计与制作。
上一篇:html多行注释
下一篇:html include
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站