两栏布局
方案一
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{
margin: 0px;
padding: 0px;
}
body,html{
height: 100%;
}
.box1{
width: 200px;
height: 100%;
background-color: tomato;
float: left;
}
.box2{
height: 100%;
margin-left: 200px;
background-color: thistle;
}
</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
</body>
</html>
方案二
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{
margin: 0px;
padding: 0px;
}
body,html{
height: 100%;
}
.box1{
width: 200px;
height: 100%;
background-color: tomato;
float: left;
}
.box2{
height: 100%;
width: calc(100% - 200px);
background-color: thistle;
float: left;
}
</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
</body>
</html>
三栏布局
方案一
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{
margin: 0px;
padding: 0px;
}
body,html{
height: 100%;
}
.box1{
width: 200px;
height: 100%;
background-color: tomato;
float: left;
}
.box2{
height: 100%;
width: calc(100% - 400px);
background-color: thistle;
float: left;
}
.box3{
height: 100%;
width: 200px;
background-color: antiquewhite;
float: left;
}
</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
</body>
</html>
方案二
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{
margin: 0px;
padding: 0px;
}
body,html{
height: 100%;
}
.box1{
width: 200px;
height: 100%;
background-color: tomato;
float: left;
}
.box2{
height: 100%;
width: 100%;
background-color: thistle;
margin-left: 200px;
margin-right: 200px;
}
.box3{
height: 100%;
width: 200px;
background-color: antiquewhite;
float: right;
}
</style>
</head>
<body>
<div class="box1"></div>
<div class="box3"></div>
<div class="box2"></div>
</body>
</html>