O'Reilly logo

Sass and Compass Designer's Cookbook by Bass Jobsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Truncating Text with ellipses

In this recipe, you will learn how to truncate text with ellipses using Compass. The text-overflow CSS property determines how overflowed content that is not displayed is signaled to users. It can be clipped; it can display an ellipsis or a custom string. The overflow() mixin of Compass helps you write cross-browser CSS code for truncating texts with ellipses.

Getting ready

For this recipe, you will need a modern web browser. Of course, you also have to install Compass. The Installing Compass recipe of Chapter 1, Getting Started with Sass, describes how to install Compass on your system.

How to do it...

The following steps will show you how to truncate text with the Compass helper functions:

  1. Create a new Compass project ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required