Trying to achieve something like this:
It sounds simple, but there are specific requirements: - the width of the parent div should adjust according to the length of the text (is this feasible with CSS?) - random positioning of all circles is proving to be quite challenging for me.
By using border-radius
to create circles (with height, width, and border-radius
set to 50%), I'm attempting to establish a grid in JavaScript. This involves iterating through each element to retrieve its dimensions, then calculating the position based on the dimensions of the previous element (if applicable). Introducing margins can also aid in preventing overlaps. Is this approach correct?
I'm seeking suggestions on how to tackle these two issues effectively.