Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

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
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #css #hide #text #long
ADD COMMENT
Topic
Name
4+9 =