Let's say I want to increase the margin-top element by its index using the increment counter() . Sort of:
div { margin-top: calc(counter(myCounter) * 10px); }
Obviously this does not work, but I could not find any information if it could be used in any way. They did not find what stated that it was impossible to do, so I thought ...
Since counters are essentially variables supported by css, is there any way to use the number of CSS counters as a property value?
EDIT
The supposed duplicate ( Set margin (indentation) based on the counter value in CSS ) does not give an answer whether this is or is impossible, and why. He just offers a different approach.
source share