html - Making span inherit sibling width -


i have div header element , span.

how can prevent span making parent div larger?

i.e. lets span's width width of sibling heading.

example:

<div class="media-body">   <h4 class="media-heading">     lauren ipsum     <small>@ipsum - 2014-06-01t18:40:35.000z</small>   </h4>   <span>     lorem ipsum..   </span> </div> 

the span should not make div , wider if wasn't there.

example: fiddle

if understand question, want span element remain size of parent.

from looking @ code appears haven't specified maximum width of parent, span assumes keep flowing until reaches border of container. given it's not set, text keeps going until hits browser window.

your options limited 1) setting maximum width of parent, , setting span display: block; or 2) setting max width on span.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -