源代码:
下载代码
AI 编程工具
点击运行
<!doctype html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://cdn.tailwindcss.com"></script> </head> <body> <div class="relative rounded-xl overflow-auto p-8"> <p>使用 flex-row:</p> <div class="flex flex-row gap-x-4 font-mono text-white text-sm font-bold leading-6"> <div class="w-14 h-14 rounded-lg flex items-center justify-center bg-fuchsia-500 shadow-lg">01</div> <div class="w-14 h-14 rounded-lg flex items-center justify-center bg-fuchsia-500 shadow-lg">02</div> <div class="w-14 h-14 rounded-lg flex items-center justify-center bg-fuchsia-500 shadow-lg">03</div> </div> <p>使用 flex-row-reverse:</p> <div class="flex flex-row-reverse space-x-reverse gap-x-4 font-mono text-white text-sm font-bold leading-6"> <div class="w-14 h-14 rounded-lg flex items-center justify-center bg-blue-500 shadow-lg">01</div> <div class="w-14 h-14 rounded-lg flex items-center justify-center bg-blue-500 shadow-lg">02</div> <div class="w-14 h-14 rounded-lg flex items-center justify-center bg-blue-500 shadow-lg">03</div> </div> <p>使用 flex-col:</p> <div class="flex flex-col mx-auto space-y-4 font-mono text-white text-sm font-bold leading-6 max-w-xs"> <div class="p-4 rounded-lg flex items-center justify-center bg-indigo-500 shadow-lg">01</div> <div class="p-4 rounded-lg flex items-center justify-center bg-indigo-500 shadow-lg">02</div> <div class="p-4 rounded-lg flex items-center justify-center bg-indigo-500 shadow-lg">03</div> </div> <p>使用 flex-col-reverse:</p> <div class="flex flex-col-reverse mx-auto space-y-reverse space-y-4 font-mono text-white text-sm font-bold leading-6 max-w-xs"> <div class="p-4 rounded-lg flex items-center justify-center bg-purple-500 shadow-lg">01</div> <div class="p-4 rounded-lg flex items-center justify-center bg-purple-500 shadow-lg">02</div> <div class="p-4 rounded-lg flex items-center justify-center bg-purple-500 shadow-lg">03</div> </div> </div> </body> </html>
运行结果: