Say I have divs like this:
<div></div> // position: relative, right: 20px
<div></div> // position: relative, right: prev() div + 20px
Is this achievable using only HTML/CSS (no js)?
Say I have divs like this:
<div></div> // position: relative, right: 20px
<div></div> // position: relative, right: prev() div + 20px
Is this achievable using only HTML/CSS (no js)?
I am not sure with pure HTML + CSS it could be done with your structure, if not using Javascript. I am thinking of making a change in HTML structure and putting them in a parent-child divs.
Check this out:
HTML Code
<div>
<div>
AAA
</div>
<div class="sub-level">
<div>
BBB
</div>
<div>
<div class="sub-level">
CCC
</div>
</div>
</div>
</div>
CSS Code:
.sub-level {
margin-left: 20px;
}
https://jsfiddle.net/3hwhq31t/2/
Hope it helps.