首先上代码
<!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>
</head>
<style>
.left{
/* width:200px;*/
background: red;
height:300px;
flex:0 0 100px;/* 左列固定宽 */
}
.right{
/* width: 150px;*/
background: blueviolet;
height:300px;
flex:0 0 120px;/* 右列固定宽 */
}
.con{
/* width: 100%;*/
background: bisque;
font-size: 24px;
height:500px;
}
</style>
<body>
<div style="display:flex;">
<div class="left">左</div>
<div class="con"