JSFiddle - React, Tailwind, and code Playground

by Csaba Hellinger

HTML

<div class="container">
    <div class="bg">
    
    </div>
</div>

CSS

body { margin: 8em; background: #222; }

.container {
    width: 100%;
    height: 10em;
    border: 1px solid red;
    position: relative;
}

.bg {
    position: absolute;
    left: -100px;
    top: -100px;
    right: -100px;
    bottom: -100px;
    
    border: 1px solid yellow;
    
    transform: translateX(0) perspective(800px) rotate3d(0.3,-0.8,0.3, 40deg) scale(1);
    
    /*
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(3, 1fr);
    grid-gap: 0.1rem;
    */
    
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;    
}

.bg-item {
    background-color: #4448;
    width: 30px;
    height: 60px;
}

JavaScript

const bg = document.getElementsByClassName('bg')[0];
for (let i = 0; i < 8*3; i += 1) {
	const item = document.createElement('div');
    item.className = 'bg-item';
    bg.appendChild(item);
}