<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> .div1{ width: 200px; height: 200px; background-color: red; display: flex; justify-content: center; align-items: center; } .div2{ width: 100px; height: 100px; background-color: green; } .container{ display: flex; flex-direction: row-reverse; flex-wrap: wrap; } .left{ width: 20%; background-color: red; height: 100px; } .centent{ width: 60%; background-color: green; height: 100px; } .right{ width: 20%; background-color: #f2ad0a; height: 100px; } .right2{ width: 20%; background-color: fuchsia; height: 100px; } </style> <title>flex布局</title> </head> <body> <div class="div1"> <div class="div2"> </div> </div> <div class="container"> <div class="left">left</div> <div class="centent">content</div> <div class="right">right</div> </div> </body> </html>
flex布局实现双飞翼
最新推荐文章于 2023-08-23 19:18:37 发布