screen shot of how the text is looking.
The code:
<div className='flex flex-col'>
{/* {details.name} */}
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
<span className='text-muted-foreground'>
<p className='truncate max-w-full'>
{/* {details.address} */}
ssssssssssssssssssssssssssssssssssssssssssssssssss
</p>
</span>
</div>
Even after using truncate , text-clip, the text is not getting clipped.
2
Answers
You can add
w-full
orw-screen
to the parent and also add thetruncate
to parent so that first ssssss strings also get clipped, the parent element needs to have a width to clip the textTailwind
truncate
utility actually applies these css:In your code, the parent div’s width is not set so it will be
auto
by default -> The container will be expanded to show the content and the text will not be "overflow". You can check this by checking the render of those elements.Setting the width of your container might fix your issue. In your case, you can set
w-full
to let the div.