Pritesh Kiri
Pritesh Kiri

@PriteshKiri

6 Tweets 6 reads Nov 01, 2022
πŸ“ŒStill using β€œβ€¦..” manually to truncate text ??
Learn CSS text-overflow to truncate text in this thread 🧡
πŸ‘‡πŸ‘‡πŸ‘‡
=> This property specifies how overflowed content that is not displayed should be signaled to the user.
=> It can be clipped, display an ellipsis (...), or display a custom string.
=> Following properties are required for text-overflow:
- white-space: nowrap;
- overflow: hidden;
1️⃣ Truncating single line:
β‡’ Set the width of the text element and add the mandatory properties.
2️⃣ Truncating multiple lines:
β‡’ We use β€œ-webkit-line-clamp” to truncate multiple lines.
That's a wrap! 🎁
Thanks for reading this thread till the end πŸ˜ƒ
πŸ”– Bookmark this thread for the future
πŸ”ƒ Retweet the first tweet
πŸš€ Follow @PriteshKiri for more daily web development tips and tricks.
#codewithcoffee #codewithcoffeeindia

Loading suggestions...