0
I have the following html code:
<div class="wrapper">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</div>
and my css is:
* {
box-sizing: border-box;
}
.wrapper {
display: grid;
grid-template-columns: 200px 50px 100px;
grid-template-rows: 50px 50px;
}
I want every little box to have a different color
Just put a background-color for each div... I could not understand exactly your problem...
– hugocsl
Does each div have to have a class?
– user221459
can be by class or by putting a style right into the div tag. create with classes, type . red {background-color: red}, so you can use class="red" on all the elements you want that color, do the same for the other 5 colors you’ll need and that’s it, there’s no mystery. Your question is not clear, it does not explain right how you want the colors, what the limitations or rules etc
– hugocsl