常见布局:两行三列布局,三行两列布局
两行三列布局
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>两行三列</title>
<style>
html,body{
margin: 0;
}
header{
background-color: blue;
height: 150px;
}
#container{
background-color: lightblue;
height: 150px;
}
nav{
background-color: aqua;
width: 150px;
height: 100%;
float:left;
}
aside{
background-color: chartreuse;
width: 150px;
height: 100%;
float: right;
}
article{
background-color: blueviolet;
width: 150px;
height: 100%;
}
</style>
</head>
<body>
<header></header>
<div id="container">
<nav></nav>
<aside></aside>
<article></article>
</div>
</body>
</html>
三行两列布局:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>三行两列</title>
<style>
html,body{
margin: 0px;
}
header{
background-color: blueviolet;
height: 100px;
}
#container{
background-color: chartreuse;
height: 100px;
}
footer{
background-color: crimson;
height: 100px;
}
nav{
background-color: darksalmon;
height: 100%;
width: 150px;
float: left;
}
article{
background-color:darkturquoise;
height: 100%;
margin-left: 150px;
}
</style>
</head>
<body>
<header></header>
<div id="container">
<nav></nav>
<article></article>
</div>
<footer></footer>
</body>
</html>
我觉得我们平常在浏览网页基本就是这种的布局模式- -!还是很常用的,get it!