Answers for "css hide text if too long"

CSS
1

css hide text if too long

<div id="truncateLongTexts">
    test test test test
</div>

#truncateLongTexts {
  width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis // This is where the magic happens
}
Posted by: Guest on March-12-2021

Browse Popular Code Answers by Language