The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Collapse parent width containing floating elements
When you resize the example horizontally the right box will fall under the left box, which is fine. But I would like the parent div (wrapper) to become a wide as the widest child at the moment.
I would like to solve it using css only and without a magic number media-query thingy, but I can’t work it out :(
without a magic number media-query thingy
How else to you expect things to change?
You have to tell CSS to do something at some point….it isn’t psychic…or magic.
I don’t know, that’s why I’m asking. Sometimes there’s a solution to a problem you just didn’t think of, sometimes there isn’t.
CSS can’t detect content shifts or changes…it can only style things based on what you tell it to do.