I need to align the element to the edge of its "grandparent".
Here is a sample code:
<div id='grandparent'>
<div class='parent' style='display:inline-block'>
<div class='child'></div>
</div>
<div class='parent' style='display:inline-block'>
<div class='child'></div>
</div>
<div class='parent' style='display:inline-block'>
<div class='child'></div>
</div>
<div class='parent' style='display:inline-block'>
<div class='child'></div>
</div>
</div>
That way, the .parent elements will be placed inline, which will depend on the width of the #grandparent element. I need each .child element to be on the left edge of #grandparent.
Is it likely that this is possible without javascript?
source
share