【CSS】实现两栏布局
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
*{
margin: 0;
padding: 0;
}
html,body{
height: 100%;
}
/*.box1{*/
/* width: 200px;*/
/* height: 100%;*/
/* background: #ff002b;*/
/* float: left;*/
/*}*/
.box1{
width: 200px;
height: 100%;
background: #ff002b;
float: left;
}
/*.box2{*/
/* height: 100%;*/
/* background: yellow;*/
/* margin-left: 200px;*/
/*}*/
.box2{
width: calc(100% - 200px);
height: 100%;
background: yellow;
float: left;
}
</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
</body>
</html>
本文来自博客园,作者:木子欢儿,转载请注明原文链接:https://www.cnblogs.com/HGNET/p/16208180.html