代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>h5结构元素</title>
<style>
.box{
width: 800px;
margin: 0 auto;
}
header{
height: 40px;
background-color: rgb(252, 111, 111);
}
nav{
height: 40px;
background-color: aquamarine;
}
.main{
width: 800px;
height: 500px;
overflow: hidden;
}
aside{
width: 300px;
height: 100%;
background-color: rgb(190, 218, 35);
float: left;
}
article{
width: 500px;
height: 100%;
background-color: rgba(23, 179, 106, 0.747);
float: left;
}
footer{
height: 40px;
background-color: rgb(236, 165, 165);
}
</style>
<head>
</head>
<body>
<div class="box">
<header>头部</header>
<nav>导航栏</nav>
<div class="main">
<aside>边侧栏</aside>
<article>主题</article>
</div>
<footer>底部</footer>
</div>
</body>
</html>
运行结果如下: