How To Shorten Text With CSS

Treehouse on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateWeb Design3 min

About this video

A short tutorial showing how to shorten long text with an ellipsis using a few lines of CSS, then wrapping the technique in a Sass mixin. It suits people who already write CSS and want a reusable approach.

What you’ll learn

  • Truncate long text to a single line with an ellipsis in CSS
  • Turn the truncation rules into a reusable Sass mixin