Is there a way to use tailwindcss to ensure that the first <p>
child truncates or hides overflow as its container shrinks? I've tried using classes like whitespace-nowrap
and overflow-hidden
, but the text always wraps regardless. Any suggestions on how to achieve this?
The flex boxes seem to work fine, with the first text shrinking while the second remains the same size as the inner-fb-one
and inner-fb-two
flex boxes shrink. The only issue is getting the text to not wrap and hide the overflow.
To c
<div className='flex flex-row ml-3 space-y-1 items-end border' id='container-fb'>
<div className='flex flex-row items-center' id='inner-fb-one'>
<p className='whitespace-nowrap'>truncate this first child as the container shrinks</p>
<p className='shrink-0'>keep this the same size</p>
</div>
<div className='flex flex-row items-center' id='inner-fb-two'>
<p className='whitespace-nowrap'>truncate this first child as the container shrinks</p>
<p className='shrink-0'>keep this the same size</p>
</div>
</div>