I'm currently working with flexbox and it forces my p tag's width to its max-width.
Anyone knows how to set a p tag's width to where line breaks?
.container {
max-width: 190px;
border: solid 1px #000;
display: flex;
justify-content: space-between;
}
.container p {
background-color: #000;
color: #fff;
}
.long {
width: 114px;
}
<div class="container">
<p>here</p>
<p>this is short</p>
</div>
<div class="container">
<p>here</p>
<p>this is a very long lineeeeeee</p>
</div>
<br> Expected: p's width should only be up to where line breaks
<div class="container">
<p>here</p>
<p class="long">this is a very long lineeeeeee</p>
</div>