flex布局实现双飞翼
<!DOCTYPE html>
<html>
<head>
<title>css布局有几种方式呢</title>
<style type="text/css">
.content {
display: flex;
height: 100%;
}
.left, .right {
background: red;
width: 200px;
height: 500px;
}
.center {
flex: 1;
background: blue;
width: auto;
height: 500px;
}
</style>
</head>
<body>
<div class="content">
<!-- flex实现双飞翼 -->
<!-- <div class="left"></div>
<div class="center"></div>
<div class="right"></div> -->
</div>
</body>
</html>
float布局实现双飞翼
<!DOCTYPE html>
<html>
<head>
<title>css布局有几种方式呢</title>
<style type="text/css">
.content {
height: 100%;
}
.left {
background: red;
width: 200px;
height: 500px;
float: left;
}
.right {
background: red;
width: 200px;
height: 500px;
float: right;
}
.center {
background: blue;
width: auto;
height: 500px;
margin: 0 200px;
}
</style>
</head>
<body>
<div class="content">
<!-- float实现双飞翼 -->
<div class="left"></div>
<div class="right"></div>
<div class="center"></div>
</div>
</body>
</html>