可以测试右侧编辑器中的代码,感受一下flex布局。
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>flex布局</title> <style type="text/css"> .box { background: blue; display: flex; } .box div { width: 200px; height: 200px; } .box1 { background: red; } .box2 { background: orange; } .box3 { background: green; } </style> </head> <body> <div class="box"> <div class="box1"></div> <div class="box2"></div> <div class="box3"></div> </div> </body> </html>