My DIV is filled with user-generated content, which sometimes begins with an item that has a margin-top that overflows the container, creating a gap between it and preceding elements. I've discovered that changing the display property to either inline-block or floating left/right can solve this issue, as can adding a padding-top value.
However, using the first two options will cause the container to shrink its width to fit its contents, which is undesirable. Using padding-top is not ideal because it creates a gap. Setting a specific width for the container is not feasible due to a templating system with over 60 layouts.
Is there a CSS solution to resolve the margin-overflowing or shrinking issue without having to modify all 60+ layouts in the templating system?