I am dealing with a situation where I have a div
containing a header element and a span
.
Is there a way to prevent the span
from expanding the size of its parent div
?
In other words, I want the width of the span
to be limited to the width of the adjacent heading.
For instance:
<div class="media-body">
<h4 class="media-heading">
John Doe
<small>@johndoe - 2019-10-15T12:30:45.000Z</small>
</h4>
<span>
Lorem ipsum..
</span>
</div>
The goal is for the presence of the span
not to affect the overall width of the div
.
Here's an example: Sample fiddle