CSS - Truncate multi-line text with ellipsis

0 votes
162 views
added Aug 16, 2017 in CSS by anonymous
edited Feb 11, 2019 by LC Marshal
.ellipsis {
  display: block;
  display: -webkit-box;
  max-width: 400px;
  height: 109.2px;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.625;
}

/*or */

.ellipsis {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...