I am trying to use CSS text-overflow: ellipsis property on a HTML div having dynamic height. JS fiddle link is https://jsfiddle.net/GS2306/bj8jg6nc/1/
#first {
max-height: 310px;
width: 300px;
border: 1px solid red;
}
.one {
max-height: 150px;
width: inherit;
border: 1px solid blue;
font-size: 40px;
overflow: hidden;
text-overflow: ellipsis;
min-height: 100px;
white-space: nowrap;
}
.two {
height: 100px;
width: inherit;
border: 1px solid green;
}
I am not able to see the full text occupying the available space.
But when I remove the "white-space: nowrap" property from the div with class "one", I can see the text occupying the available space. https://jsfiddle.net/GS2306/bj8jg6nc/2/
How to make the text occupy the maximum width of 150 px in this case and show the overflowed text as ellipsis for the remaining part