For overflow in a textbox, I know we have the scroll option and the “cutoff” option. However, we would like it to show the ellipsis (…) where it cuts off due to the size of the block. I am assuming this is something we will need code for. Does anyone know how to do this? Thanks!
Now add the truncate class to any element and you’ll get an ellipsis for the overflow.
Be aware that you’ll see the results in the designer only if you use the custom code component method, rather than the box at page or site level. If you have a navbar that is a symbol on all page, you can place your custom code inside of it for conveniency, as it will get all benefits (seeing the results inside of the designer and impact all possible pages)
There are 2 conditions for ellipsis to work:
The element’s width must be constrained in px (pixels). Width in % (percentage) won’t work.
The element must have overflow:hidden and white-space:nowrap set.
You need to help me understand the issue, I don’t at the moment. At the moment your block expands naturally like if it was 100%, and that’s ok. And that’s also the case for mobile… so I don’t understand why you need to set the width in px here…
Anyway, if you want to control the width in px, wrap the text in a DIV and set the width on this div.
Is there a native/simpler way to do this in the Webflow designer now? Would love to be able to truncate blog post summaries with an ellipsis if possible.
Step 1. In your site-wide custom code Header section, add .truncate { white-space: nowrap; text-overflow: ellipsis; } inside style tags.
Step 2. Add tag ‘truncate’ to your text element:
Step 3. Set Overflow hidden on your text element:
Step 4. Set a specific px height of your choosing for your textbox that correlates to the number of lines you wish to display before the ellipses appears