CSS - text truncation for one liner

0 votes
70 views
added Oct 25, 2023 in CSS by lcjr First Warrant Officer (11,930 points)
.url-container {
  width: 200px; /* Set the width of the container */
  white-space: nowrap; /* Prevent the text from wrapping to the next line */
  overflow: hidden; /* Hide any overflowing content */
  text-overflow: ellipsis; /* Display an ellipsis (...) when the text overflows */
}

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...