<!DOCTYPE html>
<html>
<head>
<style> 
.box{ width: 300px; height: 100px; background-color: red; display: -webkit-box; display: -moz-box; display: box;}
.siblings-left{ -webkit-box-flex: 4; -moz-box-flex: 4; box-flex: 4; background-color: green;}
.siblings-right{ -webkit-box-flex: 2; -moz-box-flex: 2; box-flex: 2; background-color: blue;}
</style>
</head>
<body>
<div class="box">
    <div class="siblings-left"></div>
    <div class="siblings-right"></div>
</div>
</body>
</html>

均分,高版本可代替float

IE高低版本据不支持

相关文章:

  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-01
  • 2021-04-03
猜你喜欢
  • 2022-02-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2022-01-17
相关资源
相似解决方案