1.父级div定位relative,子级右侧div position left:左边宽度,right:0
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<style>
.container{
position:relative;
width:500px;
height:500px;
border:1px solid black;
}
.left{
width:100px;
height:100%;
background-color: aqua;
}
.right{
position:absolute;
left:100px;
top:0;
right:0;
height:100%;
background-color: bisque;
}
</style>
<body>
<div class="container">
<div class="left"></div>
<div class="right"></div>
</div>
</body>
</html>
2.父级:display:flex;子级:flex:1;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<style>
.container{
display:flex;
width:500px;
height:500px;
border:1px solid black;
}
.left{
width:100px;
height:100%;
background-color: aqua;
}
.right{
flex:1;
height:100%;
background-color: bisque;
}
</style>
<body>
<div class="container">
<div class="left"></div>
<div class="right"></div>
</div>
</body>
</html>
3.calc(100%-左边宽度)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<style>
.container{
width:500px;
height:500px;
border:1px solid black;
}
.left{
float:left;
width:100px;
height:100%;
background-color: aqua;
}
.right{
width:calc(100% - 100px);
height:100%;
margin-left:100px;
background-color: bisque;
}
</style>
<body>
<div class="container">
<div class="left"></div>
<div class="right"></div>
</div>
</body>
</html>