固比布局(flex布局)

tech2025-01-15  4

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>固比布局</title> <style> html, body { width: 100%; height: 100%; margin: 0; padding: 0; } body { display: flex; } #box1 { width: 200px; height: 100%; background-color: pink; } #box2 { flex: 1; background-color: blue; } #box3 { width: 200px; height: 100%; background-color: green; } </style> </head> <body> <div id="box1"></div> <div id="box2"></div> <div id="box3"></div> </body> </html>
最新回复(0)