赞
踩
思路:左侧为固定width,右侧为所有
- <style type="text/css">
- .wrap {
- display: flex;
- justify-content: space-between;
- }
-
- .left,
- .right,{
- height: 100px;
- }
-
- .left {
- width: 200px;
- background: coral;
- }
-
- .right {
- flex:1;
- background: lightblue;
- }
-
- }
- </style>
- <div class="wrap">
- <div class="left">左侧</div>
- <div class="right">右侧</div>
- </div>
- <style type="text/css">
- .wrap {
- display: flex;
- justify-content: space-between;
- }
-
- .left,
- .right,
- .middle {
- height: 100px;
- }
-
- .left {
- width: 200px;
- background: coral;
- }
-
- .right {
- width: 120px;
- background: lightblue;
- }
-
- .middle {
- background: #555;
- width: 100%;
- margin: 0 20px;
- }
- </style>
- <div class="wrap">
- <div class="left">左侧</div>
- <div class="middle">中间</div>
- <div class="right">右侧</div>
- </div>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。