I want to have a div just as wide as the longest row of inline children. But I don't get to archive this - the div will get added some space to the right in most cases.
If you try out the following example, you will see the empty red space right of "Text 4". I would love to see no space and the end of the div.outer right after the last pixel of the "4".
<div style="max-width: 224px;">
<div class="outer">
<div>Text 1</div>
<div>Text 2</div>
<div>Text 3</div>
<div>Text 4</div>
<div>Text 5</div>
</div>
</div>
.outer {
display: inline-block;
background: red;
}
.outer > div {
display: inline-block;
}
I hope you can help me with this so easy looking challenge!