<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>flex 三栏式布局</title> <style> *{ margin: 0; padding: 0; } .wrapper{ display: flex; display: -webkit-flex; display: -moz-flex; flex-direction: row; width: 600px; height: 200px; box-sizing: border-box; border: 1px solid red; margin: 0 auto; } .middle{ flex: 1; height: 150px; background-color: gold; } .left{ flex-basis: 100px; order: -1; height: 170px; background-color: skyblue; } .right{ flex-basis: 100px; height: 170px; background-color: purple; } </style> </head> <body> <div class="wrapper"> <div class="middle">中间布局</div> <div class="left">左侧布局</div> <div class="right">右侧布局</div> </div> </body> </html>