Probably is a stupid question. I look for it on Google but honestly I don't know how search it.
Look at this example:
.container {
border: 5px solid black;
}
.text {
border: 1px solid red;
margin: 5px;
}
<div class="container">
<div class="text">text1</div>
<div class="text">Long text long text long text</div>
<div class="text">example</div>
</div>
Why the text containers are long as the parent container and not as long as the inside text? And how can I do to make the text container long as the text?