Handling Short And Long Content In CSS

Long content

Overflow wrap

.card {
  overflow-wrap: break-word;
}

Hyphens

.element {
  hyphens: auto;
}

Text truncation

.element {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.element {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

Horizontal scrolling

.code {
  overflow-x: auto;
}

Short content

Setting a minimum width