I have some elements at the page with display: block, but I need some elements to take only as much content as they require, so I can either use
display: inline-block;
(the problem with this one is that adjanced margins are not merged, so if mixing elements with block and display-block margings do not look consistent)
or
display: block;
width: fit-content;
The problem with this is that fit-content do not work in IE, and even more MS Edge detection CSS tricks might not work in the future.
Anyone knows of an elegant problem to solve this problem?
So I need elements to have all properties as display: block but to have width: fit-content, or to behave like display: inline-block but that their margins merge with margins of adjanced elements.
An illustration the problem (still unsolved):