Open wolichuang opened 3 years ago
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> <style> html, body { width: 100%; height: 100%; } body { margin: 0 auto; } .container { width: 100%; height: 100%; display: flex; } .left, .right { flex: 0 0 auto; width: 250px; height: 100%; } .content { flex: 1 1 auto; height: 100%; } .red { background-color: coral; } .blue { background-color: cornflowerblue; } </style> </head> <body> <div class="container"> <div class="left red">left</div> <div class="content">middle</div> <div class="right blue">right</div> </div> </body> </html>