<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div class="box"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">1</div> <div class="item">2</div> </div> </body> <style> .box { display: flex; flex-wrap: wrap ; justify-content: center; align-items: center } .item { width: 30%; height: 50px; border-radius: 20px; margin: 20px; background-color: beige; } </style> </html>
标签:flex,center,弹性,简易,html,wrap,20px From: https://www.cnblogs.com/uoky/p/18396427