Looking for a way to make a div wrap around a changing number of child elements without specifying a width for the parent?
I've managed to get the content wrapping by floating both the child and parent elements, but I'm facing an issue when the child elements move to the next line as there's excess space on the right side. My goal is to have the parent wrap tightly around its children.
You can check out a demo I created here: http://jsfiddle.net/UMgct/4/
#parent currently displays the undesired behavior, while #parent2 and #parent3 demonstrate what I want to achieve without explicitly setting the width. I understand why #parent behaves the way it does, but I can't figure out how to achieve my desired result.
If you have any suggestions or ideas, I would greatly appreciate it!