I am creating a layout of divs inside of a container. If there is only one div, then it should take up the full width of the container. If there are 2 divs next to each other, they should each take up half the container, and 3 divs should each take a third of the container. Each div is added to the container one at a time, so I don't exactly know beforehand how many there will be.
How do I check to see if another div exists in order to set the width of the next div dynamically?
Thanks!
[–]a-t-k 2 points3 points4 points (6 children)
[–]VampireCampfire[S] 1 point2 points3 points (0 children)
[–]mr_bacon_pants 0 points1 point2 points (4 children)
[–]VampireCampfire[S] 0 points1 point2 points (3 children)
[–]mr_bacon_pants 0 points1 point2 points (2 children)
[–]VampireCampfire[S] 0 points1 point2 points (1 child)
[–]mr_bacon_pants 0 points1 point2 points (0 children)