P粉1876770122023-08-29 10:26:21
可以考慮使用flex
、flex-wrap
、justify-center
#7 項:
#<div class="flex flex-wrap justify-center gap-2"> <div class="h-40 w-60 bg-cyan-200"></div> <div class="h-40 w-60 bg-cyan-200"></div> <div class="h-40 w-60 bg-cyan-200"></div> <div class="h-40 w-60 bg-cyan-200"></div> <div class="h-40 w-60 bg-cyan-200"></div> <div class="h-40 w-60 bg-cyan-200"></div> <div class="h-40 w-60 bg-cyan-200"></div> </div>
#8 項目:
#<div class="flex flex-wrap justify-center gap-2"> <div class="h-40 w-60 bg-cyan-200"></div> <div class="h-40 w-60 bg-cyan-200"></div> <div class="h-40 w-60 bg-cyan-200"></div> <div class="h-40 w-60 bg-cyan-200"></div> <div class="h-40 w-60 bg-cyan-200"></div> <div class="h-40 w-60 bg-cyan-200"></div> <div class="h-40 w-60 bg-cyan-200"></div> <div class="h-40 w-60 bg-cyan-200"></div> </div>