flex弹性盒子布局
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>flex</title> <style> *{ padding: 0; margin: 0; } body{ background-color: red; } .container{ width: 100%; min-height: 500px; background-color: yellowgreen; display: flex; } .container .left{ width: 200px; height: 500px; background-color: purple; } .container .right{ width: 150px; height: 500px; background-color: blue; } .container .center{ flex-grow: 1; height: 500px; background-color: orange; } </style> </head> <body> <div class="container"> <div class="left"></div> <div class="center"></div> <div class="right"></div> </div> </body> </html> 无需多言,就是方便。
长风破浪会有时,直挂云帆济沧海