Is it possible to resize a div
element when word wrap occurs? For demonstration purposes, look at this example from a similar question:
.mypost {
border: 1px solid Peru;
margin: auto;
min-width: 200px;
display: inline-block;
background: red;
}
.test {
margin: 10px;
background: cyan;
}
<div class="mypost">
<div class="test">I represent the imagdfv fdvdsdfsdfve.</div>
</div>
If you make the window smaller so that word wrap occurs, you will see that there is a blue empty space to the right of the text. Instead, I want the blue area to decrease until it reaches the last letter of the first line.
(In this image I am forcing word wrap. I want the blue area to shrink.)
Is this possible?