两列布局
<style>
.main{
height: 100vh;
background-color: aquamarine;
}
.col1{
width: 300px;
height:60%;
float: left;
background-color: red;
}
.col2{
height: 100%;
background-color: green;
overflow: hidden;
}
</style>
</head>
<body>
<div class="main">
<div class="col1"></div>
<div class="col2"></div>
</div>
三列布局
.main{
height: 100vh;
background-color: aquamarine;
display: flex;
}
.col1{
width: 200px;
background-color: blue;
}
.col2{
flex-grow: 1;
background-color: yellow;
}
.col3{
width: 200px;
background-color: forestgreen;
}
</style>
</head>
<body>
<div class="main">
<div class="col1"></div>
<div class="col2"></div>
<div class="col3"></div>
</div>
</body>