前端项目_flex: 1; 的使用
预览效果:
源码演示:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body{
margin:0;
padding: 0;
}
.div1{
position: relative;
display: flex;
width: 100%;
height: 800px;
}
.div2{
flex: 1;
background-color: red;
margin: 23px;
}
.div3{
flex: 1;
background-color: yellow;
margin: 23px;
margin-left: 0;
}
</style>
</head>
<body>
<div class="div1">
<div class="div2"></div>
<div class="div3"></div>
</div>
</body>
</html>
把最实用的经验,分享给最需要的读者,希望每一位来访的朋友都能有所收获!