Friday, March 28, 2014

CSS ellipsis

.ellipsis-2line{
  overflow : hidden;
  text-overflow: ellipsis;
  -o-text-overflow: ellipsis;
  -ms-text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: block;
  // fallack for firefox which doesn't support ellipsis-2line
  max-height: 3em;
}

.ellipsis{
  overflow:hidden;
  text-overflow:ellipsis;
  -o-text-overflow: ellipsis;
  -ms-text-overflow: ellipsis;
  white-space:nowrap;
  display: block;
}

No comments:

Post a Comment