truncate text css

CSS
.element{

  text-overflow: ellipsis;

  /* Required for text-overflow to do anything */
  white-space: nowrap;
  overflow: hidden;
}
div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
Source

Also in CSS: