Add

Lorem ipsum

Lorem ipsum

A
A
A
Design

0 views

4 min

How to Truncate Text in Webflow Easily

Introduction

ApproachMethodBenefit
JavaScript (this tutorial)CSS class scriptPrecise control by character count
Native Webflow CSStext-overflow: ellipsisSimple, no code, truncates by line
CSS -webkit-line-clampVia CSS embedLimits to N lines without JS

In this tutorial, Sandro, cofounder of the Gemeos Webflow agency, shows you how to easily truncate text in Webflow.

Truncating text can be super useful for a few reasons, especially when you want to keep your Hub pages consistent, like blog pages, guides, articles, and more. It helps keep the layout consistent no matter how long your text is (see image below).

Example of truncated text in Webflow

Here’s how you can do the same in under 5 minutes

1. Add a class to the text you want to truncate

In my example, I use the class "slice"

Webflow CSS class example

2. Add this code to your project

You can add this code in an embed or directly in the body of your page

 

Make sure you replace "slice" with your CSS class

good to know

var elements = document.getElementsByClassName('slice');

3. Adjust the character length to the value you want

All you need to do is replace the 64 in the code above with your own value. It’s that simple!

good to know

For a 100% JavaScript-free solution, use overflow: hidden + text-overflow: ellipsis + white-space: nowrap (one line) or -webkit-line-clamp (multiple lines). More performant than JS.

4. Publish and you’re done!

That’s all there is to it 😎

Good to know

Heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Lorem ipsum dolor sit amet consectetur.

Lorem ipsum dolor sit amet consectetur. Aliquam orci sagittis dignissim sapien praesent donec.

Lorem ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Published on 10.04.2025

You might be interested in these tutorials

Similar tutorials

SEO / GEO

5 min read

5 views

How to Set Up a Redirect in Webflow? (2026)

Updated on 19.12.2025 by Sandro DA SILVA

SEO / GEO

5 min read

5 views

Add structured data to your Webflow site?

Updated on 21.08.2025 by Sandro DA SILVA

No-code

5 min read

5 views

How to Obfuscate a Link in Webflow

Updated on 23.04.2025 by Sandro DA SILVA

Let’s f*****G GO !!

Ready to launch
Your business?

Alexandre

Max

Enora

Bryan

Cannelle

Tiphaine

You'll :heart: our collaboration...