How to wrap text till the allowed height, and then show ellipses if text overflows at the last line - CSS -


this question has answer here:

i have div -:

<div id="prep">hey jony whats up. new solar radars of great use , may evern put of wacky scientist brain strom. crazy!</div>. 

this associated css -:

#prep {     height:32px;     font-weight:bold;     overflow:hidden;     text-overflow:ellipsis;     font-family: arial, helvetica, sans-serif;     font-size:13px;     line-height:16px;     display:block; } 

clearly 2 lines of text visible. since text not fit in the div, want show ellipses @ end of last visible line of text.

you need add width, , white space.      width: 56px;     white-space: nowrap; 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -