Ellipsis for multi-line text in Chrome

Is there something like this -o-ellipsis-lastlinefor Google Chrome?

I am creating a Chrome extension and would like to ellipse multi-line text using CSS.

+5
source share
2 answers

It is not possible to create pure CSS using ellipsis due to the W3 specification for text overflow .

But if you are developing Chrome extensions, you are already using JavaScript, so here are some demos and plugins to solve your problem:

I use the latest plugin for my own projects.

+1

... , . ...

, html, ...

<div class="class_name"><%=message%></div>

... div . , , ...

<% if(message.length < 100) { %>
  <div class="class_name"><%=message%></div>
<% } else { %>
  <div class="class_name"><%=message.slice(0,80)%>...</div>
<% } %>

100 , ( 80 )

: 100 80 . , ...

, :)...

0

All Articles