Skip to content
All Answers
General

How do I truncate text with an ellipsis on Squarespace?

Single-line truncation uses text-overflow: ellipsis with white-space: nowrap. For multi-line truncation (e.g., limiting a blog excerpt to 3 lines), use the -webkit-line-clamp property.

The line-clamp approach works in all modern browsers despite the -webkit prefix. Set the desired number of lines and the overflow will be cleanly cut with an ellipsis.

/* Single line truncation */
.summary-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Multi-line truncation (3 lines) */
.summary-excerpt p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
Find more snippets in our CSS CheatsheetTry it free →

Related Questions

General

How do I find the CSS selector for any element in Squarespace?

General

How do I change the background color of a specific section in Squarespace?

General

How do I hide a specific element by its ID in Squarespace?

General

How do I add a back-to-top button in Squarespace?

A little over your head?

No shame — this stuff is hard. Let the pros handle it.

Long Drive MarketingTalk to Long Drive Marketing →