2

I have a container limited in height, and inside content in a p -tag with a long content and therefore using text ellipsis and overflow. How can I get the last sentence / word or the entire text which is displayed before the ellipsis and store it?

.grid-container > div > p {
    text-align: left;
    margin: 10px;
    -ms-hyphens: auto;
    -webkit-hyphens: auto;
    hyphens: auto;
    display: block; /* Fallback for non-webkit */
    display: -webkit-box;
    max-width: 700px;  
    max-height: 360px;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis-word;
} 
lydiaP
  • 123
  • 1
  • 13

1 Answers1

1

Just found a similar question, asking about the same but without the elipsis part. It's not exactly the answer, but it's close enough to it: How to find the last visible word position in a text container?

lydiaP
  • 123
  • 1
  • 13