I am trying to create a set of boxes. I want to try and see if I can set the size of the box based on its position within the group.
Currently this is possible if I know the number of boxes beforehand and use the :nth-child()
selector and the appropriate position.
Since CSS already has the capability to find the position of the element in the group, is it possible to use this positioning as an input for the size.
So for example something like
#boxes:nth-child() {
height:calc(n * 10);
width:calc(n * 10);
}
This purpose can easily be achieved using a server side code or even Javascript but just curious to understand if we can use CSS to achieve this, using calc
or any other feature.