Hey, I guess this is probably pretty trivial, but it's hard for me to find an answer or understand it nonetheless.
I am trying to create a grid of colored squares with an arbitrary spacing between them. This in itself is easy to do, especially because I only need nine squares. But while I look at my code, I cannot help but feel that there is a much simpler and more efficient way to accomplish this.
At the moment, I have nine different identifiers declared in my CSS, one for each square.
div.container{
position:relative;
left:50px;
top:50px;
background-color:rgb(45,45,45);
height:300px;
width:300px;
}
position:absolute;
background-color:rgb(52,82,222);
left:20px;
top:20px;
height:80px
width:80px
position:absolute;
background-color:rgb(58,82,22);
left:110px;
top:20px;
height:80px;
width:80px;
etc etc etc
What I would like to do is find a more efficient way to do this.
Thanks for the help!
danem source
share