JSFiddle - React, Tailwind, and code Playground

by Hassen Charef

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Flexbox Layout</title>
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #f4f4f4;
        }

        .container {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            max-width: 960px; /* Adjust this value based on your design requirements */
        }

        .container .item {
            flex: 0 0 calc(33.33% - 10px); /* Three items per row */
            display: flex;
            justify-content: center;
            align-items: center;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
            background: #fff;
        }

        .container .item img {
            max-width: 100%;
            height: auto;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="item"><img src="https://www.shutterstock.com/shutterstock/photos/2281013993/display_1500/stock-photo-lead-determine-your-direction-inspire-others-by-your-example-lead-the-team-cooperation-and-2281013993.jpg" alt="Image 1"></div>
        <div class="item"><img src="https://www.shutterstock.com/shutterstock/photos/2281013993/display_1500/stock-photo-lead-determine-your-direction-inspire-others-by-your-example-lead-the-team-cooperation-and-2281013993.jpg" alt="Image 2"></div>
        <div class="item"><img src="https://www.shutterstock.com/shutterstock/photos/2281013993/display_1500/stock-photo-lead-determine-your-direction-inspire-others-by-your-example-lead-the-team-cooperation-and-2281013993.jpg" alt="Image 3"></div>
        <div class="item"><img...